Is it possible to give an added row a Color.

Hello I read data of a txtfile and than place the data in a jtable.
I know how to give a selected row an other color but my question is:
Is it possible to give an added row a Color.
I make the new row this way
moddellist.addRow(new Object[]{data,""});
Now I want this added row red is this possible.
I don't know what the rowIndex or Cell number is.

The colour of a cell in a JTable is assigned by a TableCellRenderer. If you look at how that works, all it knows is the object in the cell, the table, the row and column number, and whether the cell is selected or focussed. It doesn't care when things happened.
So if you want your TableCellRenderer to colour your cells based on something that isn't in that list, then you have to modify the design of your object, the one in the cell, so that it contains information the cell renderer can use to decide what colour to render it.
Based on your description I can't say much more than that, because it's hardly a complete description of how the colour scheme is supposed to work.
And by the way the people in the Swing forum are better at answering Swing questions.

Similar Messages

  • Adding rows in web dynpro ABAP Dynamic Interactive form.

    Hi Experts,
              I am having problem in web dynpro ABAP Dynamic Interactive form.
    This is my scenario....
    I have a dynamic interactive form that has buttons to add and remove rows in a table. It works fine when I preview it , but when I render, view or save it using ADS, it no longer works. The "add" button actually does instantiate more repeating rows, because I put some trace messages in to count them, but the added rows are not displayed. How do I make them visible?
    In web dynpro java we write some coding in modify view to set the pdf form as dynamic
    IWDInteractiveForm iForm =
    (IWDInteractiveForm)view.getElement("<ID>");
    iForm.setDynamicPDF(true);
    simillarly what we need to write in web dynpro ABAP.
    Please give me solution for the same.
    Thanks,
    Sathish

    hi all,
             expecting reply from u all. pls help me and give some sugesstion.
    regards,
    vinoth.

  • How to view added rows in table; there is a horizontal line below which any added rows disppear!  Pages version 5.1 which I DESPISE!!!!

    I just replaced Pages after paying Apple $400+ for replacing a wiped-out hard-drive....
    MANY HORRIBLE QUIRKS with Pages 5.1...
    the one I listed above.....it's as if there is only one page....I can't see any added rows in the table below this arbitrary line drawn across the bottom!  I can ADD the rows, but nothing I type in them is visible!

    Do you have Pages '09 in your Applications/iWork folder?
    If not ask Apple to give it to you again.
    You own it.
    Peter

  • Numbers missing reference after adding rows

    Hi,
    I came into a strange situation (which I did not have before).
    I have a sheet summary contaning formulas that uses cells from a different sheet. The source sheet contains more than 100 rows containing different numbers which are used in more than 50 formulas in the summary sheet.
    When adding rows inbetween the existing data sheet rows, I see that the summary sheet furmulas, in some cases, do not reference to the correct row number (they all should shift to the new row number) any more (out of 50 references only four got currapted).
    Any ideas are appriciated (is this a known bug).
    Thanks,
    Ziv

    Ziv,
    First, I want to thank you for asking a question that got me thinking about something I hadn't really considered before.
    I am not entirely sure I understand your question or the test you proposed in the second post, but if I am reading it correctly, what you are expecting is the way Numbers is designed to work (and the way I have seen it work) and when I try the test from your second post I get the results I expect.
    That is, a cell reference points to a cell, not a location; if you move that cell (for example, by adding a row above it, which moves it down one row) the reference in the formula is updated to reflect the new location, but the result of the calculation doesn't change.
    But this got me wondering about how Numbers dealt with references to ranges of cells. For example, the formula =SUM(C3:C6) is equivalent to =SUM(C3, C4, C5, C6), but what happens when you add a row after row 4? Apparently, the second expression remains a sum of the values in four cells, but the values of C5 and C6 are changed to reflect the fact that they have moved to C6 and C7. However, in the first expression, the new cell is added to the range, so that it is now the sum of five values. Actually, if you add a row (or column) to one that passes through a range, in the middle, or on the outside, the formula updates to add the new cell to the range, even if you are adding cells immediately below the bottom row in the range (so none of the cells in the original range actually move).
    I'm not sure any of this has much to do with your problem, unless possibly one (or four) of your expressions is referring to a range that happens to be one cell, which would update differently from one referencing a simple cell. As Jerry has said, it's pretty hard to know anything without knowing what expressions your formulas are using.
    At any rate, thanks for making me think about something I hadn't explored before.

  • Is it possible to give a user read access to an SAP table but to restrict it to a subset of columns?

    Hi,
    is it possible to give a user read access to an SAP table but to restrict it to a subset of columns?
    Thanks,
    Digesh

    Hi Digesh,
    If your requirement is to restrict the excess to specific rows it is possible to use S_TABU_LIN, but it works only for table which contains org units, like plant, company code, etc.
    Please search for S_TABU_LIN if this is your requirement.
    Otherwise please follow Alex's suggestion.
    BR,
    Mangesh

  • Setting corect value in JTable while adding row @ run time

    HI All,
    Iam facing the following problems in Java Swing while using JTable..
    I have a JTable with 11 colums and i add row on run time..
    Since i needed the 11th column of the table to be of type CheckBox i used the follwing object in the DefaultTableModel class..
    Object[][] data =
                   {"1", "", "", "", "", "", new Double(0.0), new Integer(0), new Double(0.0), new Double(0.0),new Boolean(false) }
    When ever i wan't to delete a row i will click the Boolean Object ( which appears as a Check box ) and then delete that row.. For deleteing i am using 1 methods..
    1. By selecting the col by mouse and the click a button to delete the selected rows...
    2. By selecting the col by key board , using a Menu ShortCut key ( CTRL-F ) and then using the space key to on the value , then i use another Menu ShortCut key ( CTRL-D ) to delete all the selected rows..
    The above 2 methods work fine as for as deleting is concerned..
    But the problem starts while adding another row after deleting one or more rows..That 2 happens while the deletion had been done by the KEYBORD only..
    The problem is...
    If there is more than 1 rows and i select some rows of any order..And then delete them with the Keyboard option..and then add a rows , while adding the row @ the postion where the last row was deleted iam getting the 11th col. value ( which apears as a check box ) as selected..For example if there is 4 rows and i delete the 3rd and 4th row and then when i add rows its fine for the 3rd row and for the 4th row ( which was the last one which was slected to be deleted ) i get the option as a selected one..
    But while adding i use the above said Data object only..I then used the the
    JTablename.getValueAt(i,10); to print the value and iam geting false only..
    And more over when i try to focus in the cell in 1st row last column of the table by the setSelection method , the focus goes to the cell which appears to be enbled..
    My friends asked me to use the follwing methods before adding rows ..
    1. clearSelection()
    2. Validate()
    3. repaint()
    But the problem seems not over can anyone help....
    U can mail me to [email protected]
    Love,.
    Siva

    Yes, relatively easily, I think.
    In your end jump script set a second value in a different GPRM that identifies the last film played. This way the play all flag is set and you know which clip has just been seen.
    On resuming the play all you need to reset the play all flag to '1' and then look at the other GPRM to see which clip played last. Use a bunch of jump commands to get back in to the playback at the start of the next logical clip and it should continue through as before.
    The secret here is to clear the play all flag when showing a few clips, but use your 'resume play all' button to reset the flag and see where you were by reading the other GPRM.
    The downside here is that you could be in clip 3 when you exit the play all, but you would have to resume clip 3 from the start when you return as the 'Resume' info will get cleared if you start showing other clips in the mean time.
    Have you also considered setting up a video jukebox? You could then pick a selection of tracks to play in the order they were chosen and leave them to run through. This is a much trickier bit of scripting, but very possible!
    Stories could have made things easier, but given the set-up that you have built you can still get what you need from the scripting

  • Is it possible to give seperate authorizations for different users

    Hi all,
    I have a requirement in crystal reports.
    I have created parameters for city and calmonth.
    There are 5 cities for example chennai,mumbai patna,agra,bangalore.
    For that single calmonth is there as jun2010.
    I have done the report. In info view i want ony the chennai city guy to see only the chennai report.
    Like wise each city guy should see only their respective reports.
    In parameters while drill down i can see all the cities but i want only the respective city user to see only that report.
    So if the chennai city guy drill downs he has to see only chennai city
    so do you think is it possible to give authorizations like that?
    can any one help where can i do it either in crystal reports by writing some logic or in INFOVIEW by giving some authorizations or in BW?
    I hope everyone understand my Question.

    As I said it is much more efficient to implement row level security in the BW itself. Fetching ALL data in the CR reports first and then doing the record selection is not recommended because:
    1) You introduce additional security risk in your organization by ignoring data souce security settings.
    2) You fetch much more data that you really need in your report and you let the CR report engine do the work. SAP BW can process mass data more efficiently than the CR engine. CR is optimized for displaying data.
    3) You may violate the license agreement of your SAP BW system by providing BW data to more users than licensed.
    Regards,
    Stratos

  • How to see Added Row in a table

    Hi
    i have taken atable with visible row count 5 and ihave taken a button to add new row for that i have written code in action of that button,when ever a new row is added  that added row below the 5th row, to see that added row ishould click on UP button of table,*what i want i as soon as new row added 1st row of table should go up and remaing 5 rows should appear(2,3,4,5,6 rows)  ,suppose if i click on add row 2nd row should go up and remaingrows should appear(3,4,5,6 rows).please help me out of this problem
    Thanks
    Kishore

    Hi Kishore,
    Try this.
    public void onActionAddRow(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionAddRow(ServerEvent)
        int row = wdContext.nodeCustomer().size();
        IPrivateTestCompView.ICustomerElement custElm = wdContext.createCustomerElement();
         custElm.setCname("");
         custElm.setCno("");
         custElm.setCsal("");
         wdContext.nodeCustomer().addElement(custElm);
         //for swap the rows
         for(int i=1;i<=row;i++)
              wdContext.nodeCustomer().swapElements( 0, i );     
        //@@end
    Regards,
    Mithu

  • Reading the Data from dynamically added rows of a table...

    Hi,
                  I am using adobe interactive form (WD ABAP) in which i am adding the table rows dynamically (using Jscript code).  I have to fech these data into an internal table. But I can read only the first row data..
                  Also While adding rows dynamically the same data is repeating for the consecutive rows..
                  I have found many similar posts in sdn, but i cannot get the solution. They have mentioned about adding in WDDOINIT method. Can anyone explain me what should be done,..?
    1) How to solve repeatative data while adding rows..?
    2) How to read dynamically added row data during runtime into internal table..?
    Thanks,
    Surya.

    Discussed @ SDN lot of time before. Have a look at any of below threads:-
    Dynamic table in interactive form...
    Make dynamic tables in Adobe Interactive forms
    Adding Rows dynamically upon clicking the button
    How to get values to WebDynpro ABAP from dynamic table?
    Chintan

  • Possibility to give a pdf a variable when opening?

    Is it possible to give a PDF a variable. The problem is:
    I want to call a pdf with a url from webbrowser. When it opens it should import a xfdf or xml-file. I'm searching for a way to tell the pdf which file to import. I thought about a param in the url but I think it's not possible. Is it possible to put a javascript in an pdf which can read a cookie in which the path to the xml-file is? Is there another way to tell a pdf file in the moment when it is opend which xml file it should import??

    Try the following to capture the URL and then build your logic based on the value.
    var cURL
    cURL = this.baseURL
    xfa.host.messageBox(cURL)
    this is a JavaScript function may used in form:ready event. If you get the value displayed you can save it and use. I have no similar environment to test this myself. Please let me know how that works.
    Good Luck,
    SekharN
    www.lawson.com

  • Change field value in a table, based on another field value in the same row (for each added row)

    Please Help, I want to change field value in a table, based on another field value in the same row (for each added row)
    I am using this code :
    <HTML>
    <HEAD>
    <SCRIPT>
    function addRow(tableID) {
    var table = document.getElementById(tableID);
    var rowCount = table.rows.length;
    var row = table.insertRow(rowCount);
    var colCount = table.rows[0].cells.length;
    for(var i=0; i<colCount; i++ ) {
    var newcell = row.insertCell(i);
    newcell.innerHTML = table.rows[1].cells[i].innerHTML;
    switch(newcell.childNodes[0].type) {
    case "text":
    newcell.childNodes[0].value = "";
    break;
    case "checkbox":
    newcell.childNodes[0].checked = false;
    break;
    case "select-one":
    newcell.childNodes[0].selectedIndex = 0;
    break;}}}
    function deleteRow(tableID) {
    try {var table = document.getElementById(tableID);
    var rowCount = table.rows.length;
    for(var i=0; i<rowCount; i++) {
    var row = table.rows[i];
    var chkbox = row.cells[0].childNodes[0];
    if(null != chkbox && true == chkbox.checked) {
    if(rowCount <= 2) {
    alert("Cannot delete all the rows.");
    break;}
    table.deleteRow(i);
    rowCount--;
    i--;}}}catch(e) {alert(e);}}
    </SCRIPT>
    </HEAD>
    <BODY>
    <INPUT type="button" value="Add Row" onClick="addRow('dataTable')" />
    <INPUT type="button" value="Delete Row" onClick="deleteRow('dataTable')" />
    <TABLE id="dataTable" width="350px" border="1">
    <TR>
    <TD width="32"></TD>
    <TD width="119" align="center"><strong>Activity</strong></TD>
    <TD width="177" align="center"><strong>Cost</strong></TD>
    </TR>
    <TR>
    <TD><INPUT type="checkbox" name="chk"/></TD>
    <TD>
    <select name="s1" id="s1">
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    </select>
    </TD>
    <TD><input type="text" name="txt1" id="txt1"></TD>
    </TR>
    </TABLE>
    </BODY>
    </HTML>

    Hi,
    Let me make sure u r working with table control.
    First u have to create a event(VALIDATE) to do the validation.
    Inside the event,
    1. First get the current index where user has pointed the curson
    2. Once u get the index read the internal table with index value.
    3. Now u can compare the col1 and col2 values and populate the error message.
    1. DATA : lo_elt TYPE REF TO if_wd_context_element,
                   l_index type i.
    lo_elt = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).
         CALL METHOD LO_ELT->GET_INDEX( RECEIVING  MY_INDEX = l_index.
    above code should be written inside the event.
    Thanks,

  • Is it possible to give each page within one pdf document a specific set of print settings?

    I have a complex document (catalogue) that requires printing. There are several different printer settings required and each one is specific to each page within the document. For instance pg 1 is single sided in colour, page 2-3 is duplexed in b&w, page 3-8 is duplexed in colour, etc.... Is it possible to give each page within the pdf document a given set of print settings and then print the entire document as a whole?

    Hi jennyskop
    I assume that is not feasible ...You need to give the print command again and select the respective pages and their settings !

  • Is it not possible to give the select single field without an into clause

    Hi,
    i have to check whether my input value( only one filed) is available in the table.
    for eg i need to check whether company code is available in the table t001.
    then i will give .
    data lv_bukrs type t001-bukrs.
    lv_bukrs = 1010.
    select single bukrs from t001 where bukrs = lv_bukrs.
    here its asking for me to give a vaible to store the bukrs that is
    select single bukrs into dummyvalue from t001 where bukrs = lv_bukrs.
    Is it not possible to give the select single fieldname without an into clause

    Its Possible by declaring the tables statement
    <b>tables : AFKO.
    select single * from AFKO where <condition>.</b>
    If SINGLE is specified, the resulting set has a single line. If the remaining additions to the SELECT command select more than one line from the database, the first line that is found is entered into the resulting set. The data objects specified after INTO may not be internal tables, and the APPENDING addition may not be used. The addition ORDER BY can also not be used.
    An exclusive lock can be set for this line using the FOR UPDATE addition when a single line is being read with SINGLE. The SELECT command is used in this case only if all primary key fields in logical expressions linked by AND are checked to make sure they are the same in the WHERE condition. Otherwise, the resulting set is empty and sy-subrc is set to 8. If the lock causes a deadlock, an exception occurs. If the FOR UPDATE addition is used, the SELECT command circumvents SAP buffering.
    Notes
    When SINGLE is being specified, the lines to be read should be clearly specified in the WHERE condition, for the sake of efficiency. When the data is read from a database table, the system does this by specifying comparison values for the primary key.
    If accessing tables for which SAP buffering is planned for single records, the SAP buffer is bypassed if the addition SINGLE is not specified. This behavior depends on the current implementation of the database interface and may change in future releases. In particular, it should not be used to bypass the SAP buffer. You should use the explicit addition BYPASSING BUFFER for this instead.
    The addition SINLGE is not permitted in a subquery.
    Regards
    - Gopi

  • Add null rows in WDDOINIT  for fetching data from dynamically added rows..

    Hi,,
    I have to fetch data from a dynamically added rows of a table.
    I have followed / gone through many forums but they ddnot mention how to add null rows in the initialization method..
    I am using WD Abap..
    Can anyone help how to bind null rows in WDDOINIT method..?
    Thanks,
    Surya

    Discussed @ SDN lot of time before. Have a look at any of below threads:-
    Dynamic table in interactive form...
    Make dynamic tables in Adobe Interactive forms
    Adding Rows dynamically upon clicking the button
    How to get values to WebDynpro ABAP from dynamic table?
    Chintan

  • Numbers 09 continuing formulas when adding rows

    Numbers 09 - I have a checkbook template but when adding rows at the bottom the formulas do not continue. I have tried adding rows from the last row "Add row below" and also while in the last cell hitting return. Neither of these work. Any suggestions?

    Hi jc,
    The rule is quite explicit: "If all the body cells in a column above the new row contain the same formula or cell
    control, the formula or cell control is repeated in the new row."
    So far there's been some information necessary to solving the problem missing from your posts. Please do the following, and supply the requested information:
    Unhide ALL rows. There are two ways to do this, depending on what was done to hid them.
    a. Click on the Reorganize button. If the checkbox beside "Show rows that match..." is checked, uncheck it.
    b. If the checkbox is unchecked, or if there are still rows hidden after unchecking it, go to the Table menu and choose Unhide all Rows.
    Click on any cell on the table to activate the table and show the Column and Row reference tabs. Hover the mouse over the tab for Row 1, then click the triangle that appears to open the local row menu. Repeat with rows 2, 3, 4, 5 and 6 until you find the first row whose menu starts with the item shown below. Which row has this menu item on your table?:
    Now click on cell G2 (the first cell containing a balance).
    Select and Copy the whole formula from this cell. Paste it into your reply to this message.
    Repeat step 3 with the formula from cell G3. Paste it directly below the formula from G2, using the example below as a guide:
    G2: (paste formula)
    G3: (paste formula)
    Regards,
    Barry

Maybe you are looking for

  • Table problems in ie explorer

    Hi everyone, Just made a site (www.prodetail.ie) and was testing it in firefox during design but now when i look at it in ie explorer there's two problems, as you'll see, the menu on the left is too wide and the menu above the flash is suspended, it

  • System Restore (Need to know if I can re-install PS CS3 Extended after system restore)

    Hope you can tell me if I am able to re-install PS CS3 Extended after a system restore? Please Help. Thanks In advance.

  • Formula to enforce sentence formatting

    Post Author: Janis CA Forum: Formula I have searched the forums and have not found an answer to this... I have a text field on my report which is basically used for lengthy notes ( ten sentences or so) on a particular contact/customer. My users are a

  • Load swf into an instance

    In the first frame of my movie, I want to load a swf into 'cwgmap' mc instance, which is inside 'thumbs' mc instance. I am attempting (with no joy!) thumbs.cwgmap.loadMovie("2014_map/thumbs.swf"); Any ideas how I can achieve this? The action must be

  • Re-synching multiple edits on one of multiple tracks

    I am having sync problems in sequences that had randomly accepted non- 48htz audio rate captures. As I look at the series of edits which are now all out of sync and all located on the same track and wonder if there is a way to resync them easily acro