Row Coloring problem

hi all,
i am trying to color a row in a table, my table contains 2 columns and about 100 row, whenever the second row contains the word "Updated", I want to highlight the ENTIRE row yellow, the code i provide below, only highlight the "cell" contains "Updated" and NOT the "entire row".
please help ..
  public Component prepareRenderer(TableCellRenderer renderer,int row, int column) {
                 Component c = super.prepareRenderer(renderer,row,column);
                 c.setBackground(Color.white);
                 c.setForeground(Color.black);
                 if(table.getValueAt(row, column) != null){
                      String x = table.getValueAt(row, column).toString();
                      if (x.equalsIgnoreCase("Updated")){
                           c.setBackground(Color.YELLOW);
                           c.setForeground(Color.blue);
                                                 }else{
                           c.setBackground(Color.WHITE);
                 return c;
                 }thx

This posting contains a working example:
http://forum.java.sun.com/thread.jspa?forumID=57&threadID=610474
Note: the data in the example is static. If you dynamically change the data to "Update" then you would need to add a TableModelListener to your TableModel use the fireTableRowsUpdated(...) method to force the repainting of all the other cells on the row.

Similar Messages

  • Re: Is it possible to change row colors on array fields ors

    HI Martin!
    Yes, it is possible to change row colors on array fields.
    I have attached a PEX (tools.pex) which has an object which changes FillColor
    and PenColor for Arrays. The PEX has it's own test window, so you can try
    various combinations. (There are a few other Objects in the Project which are
    not relevant
    I'm not sure that you can change colors on individual choices in a scroll list.
    I haven't tried playing around with it.
    The test window actually changes the color of scroll lists as well.
    The object keeps track of which rows have changed color, same with pen color, so
    that when you scroll it keeps track of which rows are a different colors.
    The pex is self-contained, just import the file and do a test run.
    Please let me know if you have any problems.
    -later
    -labeaux
    Is it possible to change row colors on array fields or scroll lists?
    I need to create a list field that will allow me to dynamically change the
    fillColor and/or penColor attributes of individual rows. (I just want to
    highlight the rows, and those seem to be the obvious attributes...) It appears
    you can't do that on scroll lists (the elements are list elements, and don't
    have those attributes) and I can't figure out how to do it on an array field
    either. Any ideas for how to accomplish this?
    -Martin ([email protected])

    FreshWebmuse,
    Version 2 of iCal has the "Group Calendar" feature. It was released as part of Mac OS X v10.4, and if you really want/need that feature you will have to upgrade to Tiger.
    ;~)

  • Conditional alternating row colors

    Hello
    I have a report of companies an their country which is ordered by the column country. I'd like to have a alternating row color for every new country and not for every new row as it is in custom settings.
    Is that possible? How can I do that?
    Regards Felix
    Edited by: Felix on 21.09.2011 12:33

    Hi Scott
    sorry, I still not quite understand how to do, because which row must be colored depends on the number of countries in the database and alphabetic order of the countries.
    For example I show you only the country row of an example report and its row color as it should be right of it (because you cannot color text in this forum):
    [Country Row] [Row color]
    Albania light blue
    Albania light blue
    Albania light blue
    Albania light blue
    Andorra light green
    Andorra light green
    Andorra light green
    Andorra light green
    Argentina light blue
    Australia light green
    Australia light green
    Australia light green
    Once some data rows are inserted with a new country it should look like this
    [Country Row] [Row color]
    Albania light blue
    Albania light blue
    Albania light blue
    Albania light blue
    Algeria light green (new data)
    Algeria light green (new data)
    Algeria light green (new data)
    Andorra light blue (color switched)
    Andorra light blue (color switched)
    Andorra light blue (color switched)
    Andorra light blue (color switched)
    Argentina light green (color switched)
    Australia light blue (color switched)
    Australia light blue (color switched)
    Australia light blue (color switched)
    Now the row color of rows beneath Algeria changed (in order to keep the alternating row color alternating)
    I hope I now pointed out my problem more clearly.
    Thanks
    Felix

  • Row Color Help

    Hello,
    I have a .RTF template that I am modifying from a co-worker that I am not getting much assistance on. My problem is when Previewing the .RTF Template using PDF my row colors do not appear different for each row. The template is fine when not grouping but I think the grouping of the report causes this problem. Can anyone take a look at my template and/or shead any knowledge on this matter? Thanks ahead of time.

    I'm sorry, I had that backwards (which I included the code example and should have clued me in on NOT versus ONLY, i.e., alternate row coloring ONLY works in PDF).
    3.1.7 Alternate Table Rows Formatting Not Working in HTML, RTF, and Excel Outputs
    This issue applies to Versions 10.1.3.3, 10.1.3.3.1, 10.1.3.3.2, 10.1.3.3.3, 10.1.3.4, and 10.1.3.4.1.
    The user guide contains the "Row Formatting" topic that describes how to set the background color on alternate rows in a tabular report. This description works for PDF output only. In HTML, RTF, and Excel output formats, the alternate rows do not show the background color. In these output formats, all the rows appear with a white background.
    This issue has no workaround.

  • My song lists used to alternate row colors but now they're all white... How do I undo this ?

    I do not know how this problem began.  All I know is that in a guest account, the colors of the rows alternate between white and blue.  But now the background is completely white.  However, if a webpage or another window overlaps the iTunes page, immediately off the edge of the overlapping page you can see the alteration of colors just a little bit.

    This was driving me crazy too, after some digging around here in the forums I found the problem.
    Go to System Preferences
    Click on Accessibility
    Under Display, move the slider labeled "Enhance Contrast" all the way to the left (Normal)
    You should now have alternating row colors back!

  • Want robust solution for alternating row color, resetting every group

    I would like a solution for displaying an alternating row color for my detail rows that resets every group, so that row 1 is always gray.
    Our Crystal designer provided this code to me:
    @rowcnt formula, suppressed, placed in Detail row:
    Shared numbervar rowcnt;
    rowcnt := rowcnt + 1;
    @resetrowcnt, suppressed, placed in Group row:
    Shared numbervar rowcnt;
    rowcnt := 0;
    Formatting formula, placed in Color in Detail > Section Expert:
    Shared numbervar rowcnt;
    if Remainder(rowcnt, 2) <> 0 then
    color(241,241,241)
    else
    crWhite
    This was working fine for me.
    However, it is suddenly not working in one of my reports.
    The report does happen to have two groups (rowcount.png).
    When the report is run, all rows are colored (rowcount02.png).
    This report was previously working fine!  I'm not sure what changed.
    In any case... surely there must be standard code to do this very standard formatting.
    I would be very grateful if someone could post some robust code to accomplish the following:
    REPORT DATA IN DETAIL ROW, ALTERNATE ROW BANDING:
    - Data in Detail row displays alternating row colors
    - Odd rows are always shaded, even rows not
    - Banding resets every group / does not continue pattern from previous group
    REPORT DATA IN GROUP ROW, ALTERNATE ROW BANDING:
    Some of our reports place row data in a group row (just the way it happened).
    If you could also modify your code in this case.
    Thank you!

    Hi Abhilash/Sastry, since I'm going to switch to Sastry's formulas, could you please confirm correctness of the following. I can't actually run this report, I can only provide it to our London office, bit of a lag for testing.
    @resetrowcnt:
    Whileprintingrecords;
    Numbervar cnt:=0;
    @rowcnt:
    Whileprintingrecords;
    if {HedgeDetails.StrategyID} <> previous({HedgeDetails.StrategyID}) and
    {HedgeDetails.DealID} <> previous({HedgeDetails.DealID}) then
         Numbervar cnt:=cnt+1;
    Details section (Suppress):
    not(OnFirstRecord) and
    {HedgeDetails.StrategyID}=previous({HedgeDetails.StrategyID}) and
    {HedgeDetails.DealID}=previous({HedgeDetails.DealID})
    Please note: Suppress checkbox is selected AND the above formula is entered.
    Details section (Color):
    Whileprintingrecords;
    Numbervar cnt;
    if cnt mod 2 <> 0 Then color(241,241,241) else crwhite

  • Report Template - Standard, Alternating Row Colors

    I'm using APEX 4.1.0 and theme 22 on Oracle 10g.
    I have some tabular forms in my application. For 2 of those, row deletions are allowed and I have the usual select box column to manage the row deletions. Also my users like the "Standard, Alternating Row Colors" report template and would like to see the alternating row colors whenever possible. Unfortunately I get the "Error on page." browser error in IE when I check a row selector box using this template. When I use a different report template I don't get this error.
    The tabular form functions correctly so this error is harmless, but I would like to know what it is for. I'm sure my users would rather not see that error.
    By the way, in Firefox the firebug error count increases and I get the following error in the console:
    TypeError: can't convert undefined to object
    [Break On This Error]      
    ...ovedColor)}gLastRowMoved=b}function html_RowUp(e,d){var c=$x_UpTill(e,"TR");ie_R...
    apex_4_1.min.js (line 18)Because all of the whitespace has been helpfully removed :) it's hard to see which expression is undefined and why.
    Any ideas?

    Hi Jackie,
    There must be some issues the apex_4_1.min.js file, try to reload it. In apex.oracle.com the tabular form with "Standard, Alternating Row Colors" just works fine.
    Regards,
    Natarajan

  • Macbook display color problems

    macbook, mac os 10.5.8 updated, display color problem. when i try to fix it by color sync. it says:
    /Library/Application Support/Adobe/Color/Profiles/DCDM_X'Y'Z'.icc
    Tag 'A2B1': Requiredtag is not present.
    Tag 'B2A1': Requiredtag is not present.
    Tag 'A2B2': Requiredtag is not present.
    Tag 'B2A2': Requiredtag is not present.
    Tag 'gamt': Requiredtag is not present.
    The file is locked. could not be fixed.
    /Library/Application Support/Adobe/Color/Profiles/DCI_P3.icc
    Tag 'A2B1': Requiredtag is not present.
    Tag 'B2A1': Requiredtag is not present.
    Tag 'A2B2': Requiredtag is not present.
    Tag 'B2A2': Requiredtag is not present.
    Tag 'gamt': Requiredtag is not present.
    The file is locked. could not be fixed.
    Repair done - 0 out of 2 profiles fixed.
    Kindly assist what to do.

    Welcome to Apple Discussions!
    Pictures would help. A good way to do this is to post them to a free photo sharing site like Flickr and then post a link.
    Also, you are in the original MBP section, and I think you need to post your question in the newer MBP section:
    http://discussions.apple.com/forum.jspa?forumID=1294
    Good luck!

  • Change JTable's row color on row selection

    Hello!
    Everywhere I've looked they're only explaining how to draw rows in different colors WHEN THE TABLE IS BEING CREATED, via prepareRenderer.
    But that is not what I am looking for. What I want is to actually change the row's color after the table has been drawn/rendered/whatsoever. For instance, when the user clicks on that row. The default behaviour is for the row to become blueish, but, when the user selects another row, the first selected row turns back to white. I would like to prevent that from happening. I want the row to become FIRE RED when the user clicks on it, and I want the row to remain like that for good, even when the user selects a different row. Do I make any sense here? :-)
    Thank you for your time and future suggestions.

    Everywhere I've lookedApparently you didn't look in the Swing forum, because thats where Swing related questions should be posted.
    but how do I assign a cell renderer to an entire row/table ?The easiest way is to use the prepareRenderer(...) method you have already found. My "TablePrepareRenderer" class (which you can find by searching the Swing forum) shows you how to do this.
    You will note that the color of the row is determined by data in the table. So all you need to do is add another column in the TableModel that contains the information you need to determine the row color. That column can be removed from view in the table by removing the TableColumn from the TableColumnModel.

  • Lightroom 4 color problem

    I imported tiff images into Lightroom 4 that were scanned by DigMyPics.com.  The color  of the images look good on the Windows 7 photo viewer.  It looks horrible in Lightroom 4.  My monitor is callibrated, the import develope setting is set to "none" , the box is unchecked "apply auto tone adjustments".   I think that the windows viewer is showing the accurate color of the scan and LR is not.  I don't think DigMyPics would send this awful color.  What could the issue be?     

    monitor NEC 2690 wuxi
    eye-one display 2
    Original message
    From: twenty_one
    To: [email protected]
    Received: 2/10/2013 12:30:42 PM
    Subject: lightroom 4 color problem
    Re: lightroom 4 color problem
    created by twenty_one in Photoshop Lightroom - View the full discussion
    Yes, that certainly looks like a problem with the Lightroom rendering. Skin tones and red in general is clearly off, while Windows Photo Viewer looks good.
    I'm almost certain this is a problem with the monitor profile. As troubleshooting, try to set sRGB as monitor profile (or Adobe RGB if your monitor is wide gamut), and see if the difference persists. But try to recalibrate first.
    What calibrator and what monitor?
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5062403#5062403
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5062403#5062403
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5062403#5062403. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Photoshop Lightroom by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • A color problem in Apple's publishing App

    I was wondering if you could help me with this problem,I really need some help,and here it is:
    There is a Color problem in Mac publishing applications like Pages and Keynote,including iBooks Author,which really confuse me a lot。
    When you use a certain color space(sRGB IEC61966-2.1 in this case)to create some colors with Apps like Illustrator CS6,Indesign CS6 & Photoshop CS6 etc. ,they look totally fine。BUT when you use iBooks Author (V2.0)to create the very same color with the very same color space,colors still look fine in the color panel,and here comes the problem:they look totally lousy in the actual document!!In fact,they look much lighter and faded。(See Image 1&2)
    Above:Image 1
    Above:Image 2
    And this is also terrible with photos you import。(See Image 3)
    Above:Image 3
    Please tell me what I can do to solve this problem。I know maybe this is some sort of “basic” and “general” knowledge,but I really need your help。And I can't thank you enough if you can provide some effective solutions。

    As far as I can see,  the colour pallet and how colours are seen in any app on YOUR machine will depend on the computers System Preferences>Displays>Colour - choose your preferred setting.
    I suggest first that you ensure that your colour profile settings are the same ( as your computer)  in whatever Adobe application or in fact any outside image processor you use.
    Creating or using a colour profile in Adobe and having a different profile on your system - will tend  to  give different colour hues.
    A point also to remember is whatever you set up and is  transferred to your product... when seen on an iPad may well be totally different again due to peculiarities and contrast / brighness setting of the iPad user.

  • Alternating row color for CF report Builder?

    I have a user who wants one of her reports to display
    alternating row colors for better read clarity. The reports are
    rather lengthy and the rows tend to blend in with eachother.

    Thanks Epulfy. I am going to give this a try later today.
    Much appreciated
    EDIT:: This does work. however I'm not sure how to set a
    rectangle to the background of the report so it's behind my
    details. I draw the rectangle and it just hides whatever I want to
    display. When I look at the report it does alternate with rows, but
    I can only see details from the rows that it does not alternate on.
    Any clue how to set it to the background?

  • Pavilion gv laptop colors on monitor color problem

    I'm having color problems on my laptop. While the colors on my screen aren't terrible,most of the color/textures appear washed out and muted in comparison to other laptops I own. I've tried adjusting the brightness and calibrating the colors but it didn't fix the problem. I'm not sure what the problem could be. Thank you for your help.

    Hey @crawford810 ,
    Welcome to the HP Forums!
    I understand the colours on your notebook look muted. 
    Could you please tell me which notebook model you have and the installed operating system? For information on finding your product and model numbers click here: How Do I Find My Model Number or Product Number? To see which version of Windows you are using click here: Which Windows operating system am I running?
    For an issue like this you will want to test an external monitor to see if the issue is coming from the display, the GPU, or from Windows.
    You will want to make sure your GPU and BIOS are up to date. You can download the most recent drivers and BIOS at the HP - Drivers & Downloads website.
    I look forward to your reply!
    Please click the "Kudos, Thumbs Up" at the bottom of this post if you want to say "Thanks" for helping!
    Please click "Accept as Solution" if you feel my post solved your issue, it will help others find the solution.
    The Great Deku Tree
    I work on behalf of HP.

  • DataGrid alternating row colors per column

    Is there a way to set different alternating colors to each
    column in a DataGrid. I have a datagrid where I want two of the
    columns to have different alternating row colors, one column (red
    and light red) and the other (green and light green).
    Many thanks

    You can simply set the DataGridColumn property to the
    approprate colors.
    ex.
    <mx:DataGrid y="0" x="0" width="100%">
    <mx:columns>
    <mx:DataGridColumn id="col1" backgroundColor="0x640000"
    dataField="col1"/>
    <mx:DataGridColumn id="col1" backgroundColor="0xFF0000"
    dataField="col1"/>
    <mx:DataGridColumn id="col1" backgroundColor="0x006600"
    dataField="col1"/>
    <mx:DataGridColumn id="col1" backgroundColor="0x33CC33"
    dataField="col1"/>
    </mx:columns>
    </mx:DataGrid>
    or you can use the setStyle:
    col1.setStyle("backgroudColor", 0x640000)

  • Photoshop - Motion - DVDSP Color Problem

    This message is crossposted in the Motion Forum because I'm not sure where the solution is to be found...
    I'm putting together a dvd and I wanted to create transition animations to go between the menus. I've run into a bit of a color problem, however. To explain:
    I created my main menu as a layered photoshop document (8-bit RGB, NTSC colorspace). I brought that menu into Motion, preserving all layers. I animated those layers in motion so that at the end of the animation they were another menu on the dvd, then I exported the last frame of the animation, brought it back into photoshop, and made everything line up so that it precisely matched the final frame of the animation, then saved that PSD as a new layered document. Finally, in DVD Studio Pro, I brought in the two Menu PSDs and the animated transition.
    The problem I'm running into is that the color on the transition animation is washed out and somewhat desaturated compared to the menu PSDs. Rather than the seamless transition from layered menu PSD to animation and back to layered menu PSD, you can see this altered color "pop" on the animation.
    Here's what I've checked and tried:
    -I've exported the motion project as every codec that made any kind of sense (Animation NTSC, Apple Pro Video NTSC, etc).
    -I've brought the Motion project directly into DVD Studio Pro, rather than exporting it.
    -Using the color inspector in both Photoshop and Motion, I can see that all RGB values match exactly as they should.
    -When I exported a frame of the animation and brought it back into Photoshop to create the second layered menu, the color matched exactly. In fact, I did the alignment using the "difference" layer mode, and there was no color shift at all.
    So... any ideas?
    Also: I'm going from these layered menus to a video track (first frame matches the layered menu) to another layered menu (matching the final frame of the video track)... that is the most sensible way to have animated transitions between menus, right?
    Thanks in advance for any insights.
    -W

    Well, I found a solution... DVDSP didn't like the image in NTSC, but it seems to work with Generic RGB, provided I redo all of the animation from scratch using the same Generic RGB PSDs. A bit of a pain, but I suppose that's why I did this test after completing only one of the many animations the project will demand.
    Thanks everyone for the insights.

Maybe you are looking for

  • How do I..............?????Plz help

    I am a first time programmer. What classes or imports do you need? And how do you ask for instance ask the user to enter a number from the keyboard using J Builder 7?

  • How to test E- filing GB scenario with live server.

    Hi, XI ver: 7 E-Filing ver: 1.0, patch 10 I am trying to configure e-filing for GB based on the configuration guide. After importing the latest XI content for E-Filing and HR, I have configured the outbound and inbound interfaces in ID. After complet

  • IPod white screen of death... if I can even get it on.

    So my iPod randomly decided to stop turning on. It does not respond to soft reset at all, and it does not respond when I try and connect it to a computer (I've tried three different ones). The only time it turns on, is in my iPod FM transmitter playe

  • Flash presentation using xml

    I was getting tired off the same old Powerpoint presentations so i started using Flash. It looks great but now i'm trying to explain to my boss how he can make nice looking presentations to. There's just one problem he doesn't know anything about Fla

  • Photoshop Ext. CS5 (Mac) suddenly crashing upon file open

    Hi. Any help would be appreciated. I purchased CS5.5 extended about 3 weeks ago and all was working fine. Just yesterday Photoshop started crashing whenever I try to open files. I've deleted preferences several times, validated my fonts, restarted my