How do you set the font color for a specific entire row inside a JTable?

How do you set the font color for a specific entire row inside a JTable?
I want to change the font color for only a couple of rows inside a JTable.
I've seen some ways to possibly do this with an individual cell.
Clarification on changing the font color in an individual cell would be helpful too if
there is no easy way to do this for a row.

hai,
Try out with this piece of code.Create your table and assign the renderer to each column in the table.
CellColorRenderer m_CellColorRenderer = new CellColorRenderer();
for(int i=0;i<your_JTable.getColumnCount();i++)
your_JTable.getColumnModel().getColumn(i).setCellRenderer(m_CellColorRenderer);
class CellColorRenderer extends JLabel implements TableCellRenderer
CellColorRenderer()     
setOpaque(true);     
setHorizontalAlignment(LEFT);
setVerticalAlignment(CENTER);
setBackground(Color.white);
setForeground(Color.black);
protected void setValue(Object value)
     setText((value == null) ? "" : value.toString());
public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected, boolean hasFocus, int row,int column)
     if(isSelected == true)
          setForeground(Color.red);
     else
          setForeground(Color.black);
     setValue(value);
     return this;
regards,
bala

Similar Messages

  • How can i set the alternating colors for a table rows

    Dear All,
    Please any one help me how can i set the Alternating colors for Table Rows.
    i created a theam there i set the background alternating color to brown and i set the table design properity to alternating. but it is not reflecting.

    Hi,
    The design property in Table properties should work for your requirement. Select "alternating" value for design.
    Please see the API below:
    design
    Determines the appearance of the table. The property design can take the following values and is represented by enumeration type WDTableDesign.
    alternating - The table rows are displayed alternately in a different color.
    standard - The table background has one color. The individual table rows are displayed with grid net lines.
    transparent - The table background is transparent. The individual table rows are displayed without grid net lines.
    Check whether you have changed the right property or not? Also table should contain more than one rows to test this scenario.
    Regards,
    Jaya.
    Edited by: VJR on Jun 17, 2009 6:43 PM

  • How do you change the font color in CALL-OUT text boxes in PRO XI?

    How do you change the font color in CALL-OUT text boxes in PRO XI?

    It's not so simple to find it if you don't know what you're looking for... But it can be found via View - Show/Hide - Toolbar Items - Properties Bar.

  • How do you set the default magnification for Acrobat.  All documents that I open enlarge to 174% and are too big.

    How do you set the default magnification for Acrobat.  All documents that I open enlarge to 174% and are too big.  I see how to change the size after the document is open by going to File/properties/initial view and saving this setting.  I want all documents to open at 100% when they are first opened.  Can I set this as a default view?

    Hey Kris,
    You might go to Edit> Preferences> Zoom
    Do this without opening any particular PDF so that it applies to the program itself and not just one document.
    Try this and then let me know.
    Regards,
    Anubha

  • How do I change the font color for numbering in a matching question slide?

    I have a grey image on a question slide, but the numbering for the answers in a matching question is defaulting to grey so learners can't see to match up.  How can I change the font color of these choices?  Thanks.

    You probably edited the master slide without changing the theme colors? Check the Object Style for Answers in the Object Style Manager. The numbering takes the same color as the answer text.
    All depends on the Theme colors palette that you are using. Normally Question answers use the darkest tint of the fourth color. I started blogging about color management, but description of the use of Theme colors will be published later.
    Colorful 2015 with Adobe Captivate - Captivate blog

  • Re: (forte-users) How do you change the font color onwindow.StatusText

    Hi Richard,
    In the init method insert the line
    <_StatusLine>.PenColor = C_BLUE ;
    This sets the pen color for the widget.
    StatusText is an attribute on the Window class that
    holds the value of the text. This value is then
    displayed in the specified data field that you assign.
    Hope this helps,
    Jairaj Rampershad
    System Consultant
    --- "Robinson, Richard"
    <[email protected]> wrote:
    I'm using Forte 3.0.G.2 and can't get the font color
    to change.
    I've followed the instructions in the help
    documentation by creating a data
    field widget (named it _StatusLine) and mapped it as
    a TextData. In my Init
    method I then have a chunk of code to set up the
    Window.StatusText. It
    looks like this:
    _StatusLine = new;
    Window.StatusText = _StatusLine;
    Once that's done the code updates Window.StatusText
    as needed. All this
    works fine except I can't get the font color
    changed. I've used the Window
    workshop to specify a color for the data field
    widget but it appears that
    the underlying Forte libraries has a mind of it's
    own. Any clues as what to
    do? All I'm trying to do is set the color to the
    default "information"
    color - which is blue.
    Thanks in advance
    For the archives, go to:
    http://lists.sageit.com/forte-users and use
    the login: forte and the password: archive. To
    unsubscribe, send in a new
    email the word: 'Unsubscribe' to:
    [email protected]

    It's not so simple to find it if you don't know what you're looking for... But it can be found via View - Show/Hide - Toolbar Items - Properties Bar.

  • How do you adjust the font size for the tabs and icons around the screen?

    How do  you adjust the font size of tabs and and icons to ake them larger?

    sfcalling
    Click on the text in the menu so that you see the bounding box around it. Look to the right of the Movie Menu customization workspace, Adjustments Palette, Text and edit your text font style and size.
    In this screenshot, "Glass Flowers" text in the main menu is selected and its Adjustments Palette Text editing opportunities are shown. To do comparable editing in the scene menu, click on the scene menu in the bin to bring its image up to the screen.
    Please let us know if you are OK with the details.
    Please also review the following Adobe document on disc menus which applies to both version 11 and 12.
    Adobe Premiere Elements 11 * Creating disc menus
    By the way, what computer operating system is your Premiere Elements 12 running on?
    Thanks.
    ATR

  • How do you change the character color for text msgs?

    How do you change font colors for text messages in iOS7 for an iPhone 4S?

    never mind... i got it
    its was the contentbackgroundcolor property....

  • How do you change the font color on window.StatusTextattribute?

    I'm using Forte 3.0.G.2 and can't get the font color to change.
    I've followed the instructions in the help documentation by creating a data
    field widget (named it _StatusLine) and mapped it as a TextData.  In my Init
    method I then have a chunk of code to set up the Window.StatusText. It
    looks like this:
    _StatusLine = new;
    Window.StatusText = _StatusLine;
    Once that's done the code updates Window.StatusText as needed. All this
    works fine except I can't get the font color changed. I've used the Window
    workshop to specify a color for the data field widget but it appears that
    the underlying Forte libraries has a mind of it's own. Any clues as what to
    do? All I'm trying to do is set the color to the default "information"
    color - which is blue.
    Thanks in advance

    Are you trying to change the color of the text that you have added using the "Free Text" annotation tool?
    To change the text color to black
    Tap the text.
    Select Color... from the popup.
    Tap the black button in the Color Palette.
    Reader will remember the chosen color when you add a new Free Text annotation (the same type) next time.
    Please let us know if that is not what you are trying to do.

  • How can i set the different colors for a different group ui elements

    Hi All,
                  I Created a View Container in that i crated 2 views. In first view i created a group and in second
    view also i created a group. I want to set The First view group header colour as Golden colour and for second view group heder colour as Green colour. Please any one help me on this.
    Thanks&Regards,
    Bhargava.

    Dear GLM,
                         i got that. while creating the theme, in Complex Elements select the group element and  set the primary group header colour to golden and secondary group Header colour to Green and in ur webdynpro application set the Group Design property as Primary Color for which group u want to set the Golden color and set the Group Design property as Secondary Color for which group u want to set the Green color.
    Thanks&Regards,
    Bhargava.

  • How do you set the home page for firefox for android?

    I have firefox installed on my tablet. How do i set the home page or start page?

    Hello lalbrecht5, see: https://support.mozilla.org/en-US/questions/953363
    thank you

  • How do you set a calendar alarm for a specific time on the day of the event without it being an all-day event

    Does anyone know how to set a calendar alert at a specific time on the day of the event.
    So that the alert date adjusts accordingly if you were to copy and past it to another date.
    The custom alert function kind of does this, but because it is an absolute alert (not relative) it will still refer to the date you initially set it to when you copy and paste it to another date. So this creates more work where you would have to go and manually change all the custom alerts. I have potential
    Anyone know how to set this kind of calendar alert?
    Thanks in advance

    Greetings: Set the alarm to message you (on your screen) and then snooze it every day for 15 days, or, set 15 separate alarm messages. There is probably an AppleScript somewhere on the web too, try searching that way as well.

  • How do I change the font color for track changes in pages?

    I am using the "track changes" function to edit a document in pages, and would like to change the edited text from pale yellow green to a color I can actually see.  How do I do this?

    Hello Zoolie,
    That is an easy thing to do. Go to the drop down menu View > Comments and Changes > Author Color and then just select the color that you want and you will be good to go. Take a look at the article below for more information if needed. 
    Pages for Mac 5.0: Add comments and highlight text
    https://support.apple.com/kb/PH15379
    Regards,
    -Norm G. 

  • How can i set the Header colors for a group ui element

    Hi All,
                  I Created a View Container in that i crated 2 views. In first view i created a group and in second
    view also i created a group. I want to set The First view group header colour as Golden colour and for second view group heder colour as Green colour. Please any one help me on this.
    Thanks&Regards,
    Bhargava.

    Dear Jean,
                     i creted the theam. in the Complex Element Group i changed the Primary group colour to Golden Colour and secondry group colour to Green Colour. but in my application for all group's header it iis taking the golden colour.
                             in my senario i have 2 views in view container. each view have the separate Group ui element. i wan to set golden colour for first view's group and Green colour for the Second View Group.
    how can i do that.
    Thanks&Regards,
    Bhargava.

  • How do you set the menu button for a playlist?

    I have a "Play All" playlist that I want to return to the main menu (when the menu button on a DVD remote is pressed). Right now, it's going to one of my sub menus. I can't figure out why this is happening. Any help would be greatly appreciated.

    Thanks for the responses.
    My "Play All" playlist is not a button on a menu. It is actually the "First Play" of my DVD. I want the user to be able to hit the menu on their remote and then go to the main menu. What's happening is the menu button is going to a sub menu. I find it frustrating that you cannot set the remote button options for a playlist. If this can't be done, is there at least a way to set my main menu screen as my "top menu"? I don't want to set all of my timelines to the main menu. If I were to set it that way, all of the clips from the sub menus would go back to the main menu (when the menu remote button is pressed).

Maybe you are looking for

  • Possible Bug: Ring Constant Typedef not updating...

    I have a ring constant control which is set as a strict type def. If I select an instance of the control in my block diagram and "open typedef", I can edit the values no problem. I then click "apply changes" and "save" and would expect all changes to

  • MESSAGING PROBLEM ON MY NOKIA E5, PLEASE HELP

     HI.I HAVE THE " NOKIA E5" . I HAVE A PROBLEM WITH THE MESSAGING OPTION.WHEN THE PROFILE IS GENERAL I DONT HEAR THE MESSAGE TONE AND THERE IS NO VIBRATE, PLUS I DONT SEE ON THE WALLPAPER THAT I GOT A MESSAGE.I ONLY KNOW FROM THE LITTLE LIGHT ON THE M

  • Old contacts appearing in my iPhone

    Why is it that people that I have since deleted from my contacts list on my 4S, still appear when I'm trying to send  a text to someone?  Mind you, this person was deleted sometime last year, I have not spoken to him in any way shape or form since th

  • CMR: referencing the referencing bean itself

    Hello world, I have a problem referencing a bean itself in one of its attributs. My problem is that it should be possible to define courses which themselves have prerequisite courses and courses qualifying for by visiting the prerequsite course. The

  • Traffic shaping for each user

    Hello! I want to limit bandwidth to users. Each user must have own speed. For each user I define class-map and policy-map. But I have many users (above 500), but class-map limits 256 :(. How I can resolve my problem? My config for only 2 users: ip ac