Changing JList non-editable Font color of the selected items

Hi All,
I want to change the font color of non-editable JList's selected items which is not clearly visible to user. And I need to change the font color only the selected item in this scenerio.
Could you please clarify me?
<img src="file:///C:/DOCUME~1/sgnanasi/LOCALS~1/Temp/moz-screenshot-4.png" alt="" />

[email protected] wrote:
..I want to change the font color of non-editable JList's selected items which is not clearly visible to user. And I need to change the font color only the selected item in this scenerio.Set a custom [cell renderer|http://java.sun.com/javase/6/docs/api/javax/swing/ListCellRenderer.html] *(<- link)* for the JList.

Similar Messages

  • How to change the selection background color of the selected item in the popup menu of the choice box ?

    How to change the selection background color of the selected item in the popup menu of the choice box ?
    By defaut, the selection background color likes "blue", but if I want it to be "yellow" for example, how should I do ?
    Thanks

    The id is applied by (I think) the skin class of the ChoiceBox. You don't need to define it.
    You have to apply the css in an external style sheet. You can apply the external style sheet to any parent of your choice box, or to the scene (the most usual way to do it).
    Example:
    import java.util.ArrayList;
    import java.util.List;
    import javafx.application.Application;
    import javafx.scene.Scene;
    import javafx.scene.control.ChoiceBox;
    import javafx.scene.layout.VBox;
    import javafx.stage.Stage;
    public class ChoiceBoxTest extends Application {
      @Override
      public void start(Stage primaryStage) throws Exception {
        primaryStage.setTitle("Example 2");
        final ChoiceBox<String> choiceBox = new ChoiceBox<>();
        List<String> tempResult = new ArrayList<String>();
        for (int i = 0; i < 10; i++) {
          tempResult.add("Item " + i);
        choiceBox.getItems().setAll(tempResult);
        VBox root = new VBox();
        root.getChildren().add(choiceBox);
        final Scene scene = new Scene(root, 300, 250);
        scene.getStylesheets().add("choiceBox.css");
        primaryStage.setScene(scene);
        primaryStage.show();   
      public static void main(String[] args) {
        launch(args);
    choiceBox.css:
    @CHARSET "UTF-8";
    #choice-box-menu-item:focused  {
    -fx-background-color: yellow ;
    #choice-box-menu-item .label {
    -fx-text-fill: black ;
    Message was edited by: James_D

  • The 'selected items' color randomly changes and I can't figure out why.

    Hi everybody, I recently upgraded to Firefox 13, which appears to be the most stable browser version so far and I really like it. I have loved Firefox very much, having used it since somewhere between versions 2 and 3.
    After upgrading to version 13 I noticed something that annoys me quite a bit. This may have been present before but I can't remember and I did not notice until now.
    On my computer (Windows 7 x64 Ultimate) I have set the color of the 'selected items' (specifically text) to be lime green text on a slightly off black background. I chose this color scheme because it blends very well with Firefox itself (I have the NASA night launch theme), Windows Explorer, and many web pages that I have changed to a dark theme (using the Stylish browser extension). This color scheme has excellent contrast in areas with black text on a light background, as well as light text on a dark background. It has served me well.
    After upgrading to Firefox 13 I have noticed that if the web page is dark with light text, the 'selected items' color changes to lime green text on a light grey background. (Less frequently, it changes instead to off-black text on a lime green background). I have not been able to isolate the threshold where this change occurs (meaning how dark the website background needs to be /how light the text needs to be for this to happen) nor have I found a solution.
    This problem sometimes extends even to sites that have dark text on a light background: when tabs are switched, with no input fields clicked and the address bar is not clicked. This very page (Firefox support) is apparently vulnerable as well.
    This problem only happens on rendered web pages. Firefox's menus, buttons and toolbars, as well as all other programs and Windows itself, are unaffected.
    I want the 'selected items' to remain as I have set it, and not deviate regardless of the apparent contrast or color scheme of the web page being displayed.
    [Edit #1]: Interestingly, as I was copying the information from about:support I noticed that it is affected as well.
    Any suggestions? Thanks so much, and I am sorry for the long-winded description. tl;dr look at the pictures.
    [http://i.imgur.com/vmLZ6.png selected items]
    [http://i.imgur.com/d8xsa.png example1]
    [http://i.imgur.com/2OE9J.png example2]
    [http://i.imgur.com/1lhvb.png example3]
    [http://i.imgur.com/UWOOp.png example4]

    It is always best to avoid making changes to the selected text colors.<br />
    Firefox uses an algorithm to check if the contrast is sufficient and will swap text and background colors if that test fails.<br />
    *http://mxr.mozilla.org/mozilla-central/source/layout/generic/nsTextFrameThebes.cpp#3349
    *http://forums.mozillazine.org/viewtopic.php?f=38&t=1331845

  • How to Change the Font Color in the Podcast Archive Subheadings

    If you go to pages.sparcc.org/The _Sanctuary, you will notice that the font colors in the subheadings are red. I was able to change them to the green everyone wanted except for the red "Archives". How can I change them?

    Unfortunately, the text stylings for both the main blog index page as well as the archive page are controlled by the template. If you want, you can edit the xml template files buried in the iWeb application itself, but there is no way to do this from within iWeb directly.

  • Change font color in the Text Field of a Popup Key LOV

    Hello,
    I have a question concerning Popup Key LOV.
    I want to change the font color in the Text Field of the Popup Key LOV Item.
    I searched the forum but I cannot find an answer about this! Although I searched the CSS and the Popup Key LOV Template, but I do not know where to modify the font color.
    Has anyone an idea how to solve that problem?
    Regards,
    Tim

    Hey,
    thank for your reply!
    I use style="color:#000000;" and it work in Firefox, but not in Internet Explorer 7.0!
    And that is not the first time, that there are differences in displaying those tags in the HTML Form Element Attributes and in css files, etc.
    Does anybody know I to solve that?
    Thank you,
    Tim

  • In Dreamweaver 6, I created a new fluid layout. I set up (4) DIVs. In the 3rd div, I changed the font color. The new color shows up on the website when viewed in my computer desktop, but, when viewed in a tablet and a cell phone, the color of the font doe

    In Dreamweaver 6, I created a new fluid layout. I set up (4) DIVs. In the 3rd div, I changed the font color. The new color shows up on the website when viewed in my computer desktop, but, when viewed in a tablet and a cell phone, the color of the font does not change. It's the same in Dreamweaver's Live view. It shows the new color on Desktop view and not in the cell phone or tablet view. Also, I changed the font itself in one of the DIVs and it shows up in the new font on the desktop view and website viewed thru the computer, but, not on the tablet or cell phone. Can someone please explain. I want to be able to change the fonts and colors for viewing in the tablet and cell phone, also. The fonts were all standard fonts. Sans-erif and Verdana and Arial were tried. Thanks.

    I will lock this discussion because of duplicate post.

  • Changing the font color for the complete row based on the Keyfigure Values

    Hi Experts,
    Can any one help me to find a solution for this?.
    I have a requirement, in which the Font color for the complete Row needs to be set to RED in Bex Report, when the corresponding Row Keyfigure is more than a particular value.
    Ex: Notification-Material-Customer-Def Qty-delivered Qty
          1000000 - XXXXX- AAAAAA-10-1000
    in the above example, when the Defect qty increses more than 10, then the complete Row Including the characterstics, Notification, Material, and customer Should be Highlighted in Red. This has to happen automatically once the Query is refreshed.
    Please let me know if you have any suggestion here?.
    Regard,
    Muruganand.K

    Hi,
    Step 1: Click the Format Menu in Excel(BEX Analyzer)
    Step 2: Click the Style submenu
    Step 3: there will be number of SAPBEX formats available. Each of these relates to another cell of BEx (Header, Cell Data,
                Result  Row, Hierarchies, etc.). Also, they depend on data types.
    Step 4: Select SAPBEXchatext
    Step 5: Click Modify. This displays all the standard formatting option as shown below.
    Step 6: Select Font, Color (Background/ Font).
    Step 7: Click OK on both the screens. The entire BEx output result row Font and color is modified.
    Hope it helps........
    Regards,
    Suman

  • Changed the color of the selected text

    I changed the color of the selected text in Photoshop CS6, from black (background) & white (text) to different colors. I want to know how I did it.

    Selecting tends to invert the text. Use Ctrl/Cmd h while in Text edit mode to hide the selection.

  • Set font color for the JTextField

    I'm using JTextField in my project. However, can anybody teach me how to set the font color for the font in the JTextField to other color. The default font color is black. Any idea about this?

    JTextField field = new JTextField(20);
    field.setForeground(Color.blue);
    Good luck ;)

  • Is there a way to personalize my font in my icloud email i.e. make permanent change/default settings to font, color.  I don't want to make these changes on each individual email?

    i.e. make permanent change/default settings to font, color.  I don't want to make these changes on each individual email

    Settings App > Messages > Start New Conversations From [set to your phone number].

  • How to change selected item color and the selected area size of listview

    What i really need to do is change the following things in XMAL.
    1. Changing the selection color
    2. Size of selected area 
    Thanks in advance.
    Dileepa S. Rajapaksa
    Trainee Developer
    Microsoft, Sri Lanka
    Twitter : @dsrajapaksa
    Blog : http://www.dileepatech.net

    Hi Dileepa,
    It is possible by customize the control by its template, see this for more information:
    ListViewItem styles and templates.
    By changing the selected visual state, you can change the color of the ListView item background, also the size of the selected item.
    --James
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to automatically build a table with 2 alternated font colors for the lines ?

    Hi,
    I'm looking for a way to automatically build a table with alternate background color and alternate font color for the lines.
    I have this particular project (a list of companies of an industrial area) and it is updated twice a year :
    I managed to set an automated alternate background color of the lines so this works well (white/blue/white/blue...)
    But the font color does not automatically alternates... and I do not know how to set this up...
    All the companies are ordered alphabetically so when I have to insert or delete one, the whole text of the table under the modified line is messed up. Then I have unreadable white text on white background and blue text on blue background...
    Does anyone have an idea on how to automatically alternate the font color ?
    Thank you.
    Best regards,
    G.

    Hi,
    I know this [JS] code is awful but it works. If  someone wants to correct it …! 
    At the beginning, you have an Excel file. You play a little with it [doing concatenations] to get, after importing it in ID:
    Then, just run the .jsx:
    Done! 

  • The plug-in for the selected item is not installed on your system

    Hello,
    When I want to build an application there is a "!" mark before the application and for  the Installer,  in the Project Explorer under Build Specification.
    When I ask for "explain warning" I got the message "The plug-in for the selected item is not installed on your system"
    Previously it worked well, whats happend?? (during my holyday's )
    Thanks for help, Huub

    Well, something obviously changed. Install any software and/or hardware recently? Using any hardware in your LabVIEW project? Could be the drivers for that hardware got corrupted. Try identifying what you're using and reinstall the drivers.

  • Loading only the selected item

    I am developing a data binding app where the source data is stored in the following format:
    public void LoadData()
    // Sample data; replace with real data
    this.Items.Add(new ItemViewModel() { ID = "0", LineOne = "runtime one", LineTwo = "Maecenas praesent accumsan bibendum", LineThree = "Facilisi faucibus habitant inceptos interdum lobortis nascetur pharetra placerat pulvinar sagittis senectus sociosqu" });
    this.Items.Add(new ItemViewModel() { ID = "1", LineOne = "runtime two", LineTwo = "Dictumst eleifend facilisi faucibus", LineThree = "Suscipit torquent ultrices vehicula volutpat maecenas praesent accumsan bibendum dictumst eleifend facilisi faucibus" });
    this.Items.Add(new ItemViewModel() { ID = "2", LineOne = "runtime three", LineTwo = "Habitant inceptos interdum lobortis", LineThree = "Habitant inceptos interdum lobortis nascetur pharetra placerat pulvinar sagittis senectus sociosqu suscipit torquent" });
    this.Items.Add(new ItemViewModel() { ID = "3", LineOne = "runtime four", LineTwo = "Nascetur pharetra placerat pulvinar", LineThree = "Ultrices vehicula volutpat maecenas praesent accumsan bibendum dictumst eleifend facilisi faucibus habitant inceptos" });
    this.Items.Add(new ItemViewModel() { ID = "4", LineOne = "runtime five", LineTwo = "Maecenas praesent accumsan bibendum", LineThree = "Maecenas praesent accumsan bibendum dictumst eleifend facilisi faucibus habitant inceptos interdum lobortis nascetur" });
    this.Items.Add(new ItemViewModel() { ID = "5", LineOne = "runtime six", LineTwo = "Dictumst eleifend facilisi faucibus", LineThree = "Pharetra placerat pulvinar sagittis senectus sociosqu suscipit torquent ultrices vehicula volutpat maecenas praesent" });
    this.Items.Add(new ItemViewModel() { ID = "6", LineOne = "runtime seven", LineTwo = "Habitant inceptos interdum lobortis", LineThree = "Accumsan bibendum dictumst eleifend facilisi faucibus habitant inceptos interdum lobortis nascetur pharetra placerat" });
    this.Items.Add(new ItemViewModel() { ID = "7", LineOne = "runtime eight", LineTwo = "Nascetur pharetra placerat pulvinar", LineThree = "Pulvinar sagittis senectus sociosqu suscipit torquent ultrices vehicula volutpat maecenas praesent accumsan bibendum" });
    this.Items.Add(new ItemViewModel() { ID = "8", LineOne = "runtime nine", LineTwo = "Maecenas praesent accumsan bibendum", LineThree = "Facilisi faucibus habitant inceptos interdum lobortis nascetur pharetra placerat pulvinar sagittis senectus sociosqu" });
    this.Items.Add(new ItemViewModel() { ID = "9", LineOne = "runtime ten", LineTwo = "Dictumst eleifend facilisi faucibus", LineThree = "Suscipit torquent ultrices vehicula volutpat maecenas praesent accumsan bibendum dictumst eleifend facilisi faucibus" });
    this.Items.Add(new ItemViewModel() { ID = "10", LineOne = "runtime eleven", LineTwo = "Habitant inceptos interdum lobortis", LineThree = "Habitant inceptos interdum lobortis nascetur pharetra placerat pulvinar sagittis senectus sociosqu suscipit torquent" });
    this.Items.Add(new ItemViewModel() { ID = "11", LineOne = "runtime twelve", LineTwo = "Nascetur pharetra placerat pulvinar", LineThree = "Ultrices vehicula volutpat maecenas praesent accumsan bibendum dictumst eleifend facilisi faucibus habitant inceptos" });
    this.Items.Add(new ItemViewModel() { ID = "12", LineOne = "runtime thirteen", LineTwo = "Maecenas praesent accumsan bibendum", LineThree = "Maecenas praesent accumsan bibendum dictumst eleifend facilisi faucibus habitant inceptos interdum lobortis nascetur" });
    this.Items.Add(new ItemViewModel() { ID = "13", LineOne = "runtime fourteen", LineTwo = "Dictumst eleifend facilisi faucibus", LineThree = "Pharetra placerat pulvinar sagittis senectus sociosqu suscipit torquent ultrices vehicula volutpat maecenas praesent" });
    this.Items.Add(new ItemViewModel() { ID = "14", LineOne = "runtime fifteen", LineTwo = "Habitant inceptos interdum lobortis", LineThree = "Accumsan bibendum dictumst eleifend facilisi faucibus habitant inceptos interdum lobortis nascetur pharetra placerat" });
    this.Items.Add(new ItemViewModel() { ID = "15", LineOne = "runtime sixteen", LineTwo = "Nascetur pharetra placerat pulvinar", LineThree = "Pulvinar sagittis senectus sociosqu suscipit torquent ultrices vehicula volutpat maecenas praesent accumsan bibendum" });
    this.IsDataLoaded = true;
    This will load all the items and refresh the data. The problem is as the number of items and content increases the delay in clicking the option and getting the content visible is significant and cannot be ignored. This is more annoying since the data
    is static and once loaded, it never changes. I am thinking of improving the data refresh rate and looking for ways to load only the data for the selected item and not for all the items listed above.
    Anyone has any good suggestions?
    Thanks,
    Aiseduk

    Hi Toni,
    Thanks for your reply. I am not too sure about ListBox virtualization. Can you please elaborate how it can help me in my scenario? As of now, I am exploring few possible options to achieve what I am looking for:
    1. How to restrict LoadData() to load only the selected item? Since this will only load one item performance will be better on selecting the option. Is there any way to limit "this.Items.Add(new
    ItemViewModel()" so that once an item is loaded, the flow jumps to
    this.IsDataLoaded =
    true;
    2. Is there any way to create multiple LoadData() instance and connect them using Case/Switch to the available option? This will only initiate the LoadData() for that particular instance of selected item.
    2. Take the performance hit once. Since the data is static and do not change later on do we have any option to load data once and prevent it from refreshing later on every time an option is selected? Will this impact any features depending on system (like
    theming)?
    3. Create multiple pages, one for each ID, and then somehow link them to the selected items in the list? I am able to achieve this, but this makes my project unnecessary bulky and difficult to manage.
    Once again, thank you very much for helping me on this.
    Aiseduk

  • Cannot sync ipad. statement "ipad cannot be synced because there is not enough free space to hold all of the selected items (additional 157.3 mb required) There is 1.86gb available on ipad and i am trying to remove items. any thoughts...

    annot sync ipad. statement "ipad cannot be synced because there is not enough free space to hold all of the selected items (additional 157.3 mb required) There is 1.86gb available on ipad and i am trying to remove items. any thoughts...

    If you haven't changed your sync preferences, meaning that you are not trying to add more content from the last time that you synced with iTunes, try quitting iTunes, restart your computer and then try again.
    If you are trying to add more content to the iPad than what you had before, you can only use so much of the available storage capacity that is left on the device. You probably need to leave about 10% of the space free so if you have a 16GB iPad, you might not have enough space left to sync that content that you are trying to sync.

Maybe you are looking for