Show tooltip on color list

Is it possibile to show a tooltip to display the color name?
http://s10.postimg.org/94rd93scp/Z034.png
Here is my code for ComboBox color rendering
import javafx.application.Application;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.Scene;
import javafx.scene.control.ComboBox;
import javafx.scene.control.ContentDisplay;
import javafx.scene.control.ListCell;
import javafx.scene.control.ListView;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;
import javafx.util.Callback;
public class ProvaComboRendering extends Application {
    @Override
    public void start(Stage primaryStage) {
        StackPane root = new StackPane();
        ComboBox<String> cb = new ComboBox<String>();
        cb.setPrefSize(150, 20);
        root.getChildren().add(cb);
        Scene scene = new Scene(root, 300, 250);
        primaryStage.setScene(scene);
        primaryStage.show();
    ObservableList<String> data = FXCollections.observableArrayList(
            "chocolate", "salmon", "gold", "coral", "darkorchid",
            "darkgoldenrod", "lightsalmon", "black", "rosybrown", "blue",
            "blueviolet", "brown");
      cb.setItems(data);
      Callback<ListView<String>, ListCell<String>> factory = new Callback<ListView<String>, ListCell<String>>(){
          @Override
          public ListCell<String> call(ListView<String> list){
              return new ColorRectCell();
      cb.setCellFactory(factory);
      cb.setButtonCell(factory.call(null));
      static class ColorRectCell extends ListCell<String>{
          @Override
          public void updateItem(String item, boolean empty){
              super.updateItem(item, empty);
              Rectangle rect = new Rectangle(120,13);
              rect.setStroke(Color.BLACK);
              if(item != null){
                  rect.setFill(Color.web(item));
                  setGraphic(rect);
    public static void main(String[] args) {
        launch(args);
Thanks.

Just add
setTooltip(new Tooltip(item));
in your updateItem(...) method.

Similar Messages

  • Conversion from awt to Swing, colored list widget, and awt update() method

    Now that my Interactive Color Wheel program/applet is in Swing, I guess I should continue my previous thread in here from the AWT forum ("list widget with different colors for each list item?"):
    * list widget with different colors for each list item?
    My current issue involves two canvas (well, JPanel) refresh issues likely linked to double buffering. You can see them by running the following file with "java -jar SIHwheel.jar":
    * http://r0k.us/rock/Junk/SIHwheel.jar
    [edit add]
    (Heh, I just noticed Firefox and Chrome under Windows 7 will allow you to run thie .jar directly from the link. Cool.)
    [edit]
    If you don't trust me and would rather run it as an applet, use:
    * http://r0k.us/rock/Junk/SIHwheel.html
    (For some reason the first issue doesn't manifest when running as applet.)
    1) The canvas goes "wonky-white" when the user first clicks on the wheel. What is supposed to happen is simply the user sees another dot on the wheel for his new selected color. Forcing a complete redraw via any of the GUI buttons at the bottom sets things right. The canvas behaves itself from then on, at least until minimized or resized, at which point one needs to click a GUI button again. I'll be disabling resizing, but minimizing will still be allowed.
    2) A button image, and sometimes toolTip text, from an entirely different JPanel will appear in the ULC (0,0) of my canvas.
    Upon first running the new Swing version, I had thought everything was perfect. I soon realized though that my old AWT update() method was never getting called. The desired case when the user clicks somewhere on the wheel is that a new dot appears on his selected color. This usually allows them to see what colors have been viewed before. The old paint(), and now paintComponent(), clear the canvas, erasing all the previous dots.
    I soon learned that Swing does not call update(). I had been using it to intercept refresh events where only one of the components on my canvas needing updating. Most usefully, don't redraw the wheel (and forget the dots) when you don't need to. The way I chose to handle this is to slightly modify the update() to a boolean method. I renamed it partialOnly() and call it
    at the beginning of paintComponent(). If it returns true, paintComponent() itself returns, and no clearing of the canvas occurs.
    Since I first posted about these two issues, I've kludged-in a fix to #1. (The linked .jar file does not contain this kludge, so you can see the issue.) The kludge is included in the following code snippet:
        public void paintComponent(Graphics g)
            Rectangle ulc;
         if (font == null)  defineFont(g);
         // handle partial repaints of specific items
         if (partialOnly(g))  return;
            ...  // follow with the normal, full-canvas refresh
        private boolean partialOnly(Graphics g)
         boolean     imDone = true;
         if (resized > 0)  // this "if { }" clause is my kludge
         {   // should enter on 1 or 2
             imDone = false;
             resized += 1;     // clock thru two forced-full paints
             if (resized > 2)  resized = 0;
            if (wedgeOnly)
             putDotOnWheel(g);
                paintWedge(g);
             drawSnake(g);
             drawSatSnake(g);
             updateLumaBars(g);
                wedgeOnly = false;
              else if (wheelOnly)
                wheelOnly = false;
              else
                imDone = false;  // was paint() when method was update() in the AWT version
            return(imDone);
        }Forcing two initial full paintComponent()s does whatever magic the double-buffering infrastructure needs to avoid the "wonky-white" problem. This also happens on a minimize; I've disabled resizing other than minimization. Even though it works, I consider it a kludge.
    The second issue is not solved. All I can figure is that the double buffers are shared between the two JPanels, and the artifact buttons and toolTips at (0,0) are the result. I tried simply clearing the top twenty lines of the canvas when partialOnly() returns true, but for some reason that causes other canvas artifacting further down. And that was just a second kludge anyway.
    Sorry for being so long-winded. What is the right way to avoid these problems?
    -- Rich
    Edited by: RichF on Oct 15, 2010 8:43 PM

    Darryl, I'm not doing any custom double buffering. My goal was to simply replicate the functionality of awt's update() method. And yes, I have started with the Swing tutorial. I believe it was there that I learned update() is not part of the Swing infrastructure.
    Problem 1: I don't see the effect you describe (or I just don't understand the description)Piet, were you viewing the program (via the .jar) or the applet (via the .html)? For whatever reason, problem 1 does not manifest itself as an applet, only a program. FTR I'm running JDK/JRE 1.6 under Windows 7. As a program, just click anywhere in the wheel. The whole canvas goes wonky-white, and the wheel doesn't even show. If it happens, you'll understand. ;)
    Are you aware that repaint() can have a rectangle argument? And are you aware that the Graphics object has a clip depicting the area that will be affected by painting? You might use these for your partial painting.Yes and yes. Here is an enumeration of most of the update regions:
    enum AoI    // areas of interest
        LUMA_SNAKE, GREY_SNAKE, HUEBORHOOD, BULB_LABEL, LUMA_WEDGE,
        LAST_COLOR, BRIGHTNESS_BOX, INFO_BOX, VERSION,
        COLOR_NAME, EXACT_COLOR, LUMA_BUTTON, LUMA_BARS, GUI_INTENSITY,
        QUANTIZATION_ERROR
    }That list doesn't even include the large color intensity wedge to the right, nor the color wheel itself. I have a method that will return a Rectangle for any of the AoI's. One problem is that the wheel is a circle, and a containing rectangle will overlap with some of the other AoI's. I could build an infrastructure to handle this mess one clip region at a time, but I think it would add a lot of unnecessary complexity.
    I think the bigger picture is that, though it is now updated to Swing, some of the original 1998 design decisions are no longer relevant. Back then I was running Windows 98 on a single-core processor clocked at significantly less than 1 GHz. You could actually watch the canvas update itself. The color wheel alone fills over 1000 arcs, and the color intensity wedge has over 75 update regions of its own. While kind of interesting to watch, it's not 1998 any more. My multi-core processor runs at over 2 GHz, and my graphic card is way, way beyond anything that existed last century. Full canvas updates probably take less than 0.1 sec, and that is with double-buffering!
    So, I think you're right. Let the silly paintComponent() do it's thing unhindered. If I want to track old dots on the wheel, keep an array of Points, remembering maybe the last 10. As a final step in the repainting process, decide how many of those old dots to display, and do it.
    Thanks, guys, for being a sounding board.
    Oh, I'm moving forward on implementing the color list widget. I've already added a 3rd JPanel, which is a column to the left of the main paint canvas. It will contain 3 GUI items:
    1) the color list widget itself, initially sorted by name
    2) 3 radio buttons allowing user to resort the list by name, hue, or hex
    3) a hex-entry JTextField (which is all that is there at this very moment), allowing exact color request
    The color list widget will fill most of the column from the top, followed by the radio buttons, with hex-entry at bottom.
    For weeks I had in mind that I wanted a pop-up color list widget. Then you shared your ColorList class, and it was so obvious the list should just be there all the time. :)
    -- Rich

  • How to implement tooltip for the list items for the particular column in sharepoint 2013

    Hi,
    I had created a list, How to implement tooltip for the list items for the particular column in SharePoint 2013.
    Any help will be appreciated

    We can use JavaScript or JQuery to show the tooltips. Refer to the following similar thread.
    http://social.technet.microsoft.com/forums/en/sharepointdevelopmentprevious/thread/1dac3ae0-c9ce-419d-b6dd-08dd48284324
    http://stackoverflow.com/questions/3366515/small-description-window-on-mouse-hover-on-hyperlink
    http://spjsblog.com/2012/02/12/list-view-preview-item-on-hover-sharepoint-2010/

  • How to make a tooltip for incoming list items

    Hi,
    I am trying to make a tooltip with JQuery for incoming list items. People will enter some text in a textfield en those values will be added to a list. I want to make a tooltip for every list item that will be added to the list. I want the text that people fill in in the textfield to be added in the tooltip, is this possible? And how can I do this? Thanks! This is what I have so far..
    <input type="text" id="input" placeholder="Voer item in" /> <button id="button">Toevoegen</button>
    <div id="tooltip"></div>
    $(document).ready(function(e) {
      $('#button').on('click', function (){
      var toevoegen = $('#input').val();
      var verwijderen = '<a href = "#" class = "verwijderen">Verwijderen</a>'
      <!--add list item-->
      $('#boodschappenlijst').prepend('<li>' + toevoegen + '' + '\t' + verwijderen + '</li>');
    <!--remove list item-->
    $('#boodschappenlijst').on('click', '.verwijderen', function(){
      $(this).parent('li').remove();
    <!-textfield empty-->
    $('#input').on('click', function (){
      $(this).val('')
    $('#boodschappenlijst').hover(
    function (){
      $('#tooltip').css('display', 'block')
    function (){
      $('#tooltip').css('display', 'none')
    #tooltip {
      position: absolute;
      top: 100px;
      right: 300px;
      border: 1px solid #000000;
      border-radius: 5px;
      color: black;
      width: 100px;
      display: none;
    The tooltip appears, but I want the text that people fill in in the textfield to be added in the tooltip

    Hi,
    I am trying to make a tooltip with JQuery for incoming list items. People will enter some text in a textfield en those values will be added to a list. I want to make a tooltip for every list item that will be added to the list. I want the text that people fill in in the textfield to be added in the tooltip, is this possible? And how can I do this? Thanks! This is what I have so far..
    <input type="text" id="input" placeholder="Voer item in" /> <button id="button">Toevoegen</button>
    <div id="tooltip"></div>
    $(document).ready(function(e) {
      $('#button').on('click', function (){
      var toevoegen = $('#input').val();
      var verwijderen = '<a href = "#" class = "verwijderen">Verwijderen</a>'
      <!--add list item-->
      $('#boodschappenlijst').prepend('<li>' + toevoegen + '' + '\t' + verwijderen + '</li>');
    <!--remove list item-->
    $('#boodschappenlijst').on('click', '.verwijderen', function(){
      $(this).parent('li').remove();
    <!-textfield empty-->
    $('#input').on('click', function (){
      $(this).val('')
    $('#boodschappenlijst').hover(
    function (){
      $('#tooltip').css('display', 'block')
    function (){
      $('#tooltip').css('display', 'none')
    #tooltip {
      position: absolute;
      top: 100px;
      right: 300px;
      border: 1px solid #000000;
      border-radius: 5px;
      color: black;
      width: 100px;
      display: none;
    The tooltip appears, but I want the text that people fill in in the textfield to be added in the tooltip

  • Apple TV does not show up in device list

    I've read all the post with the same subject but still can not get the Apple TV to show up in the device list of itunes.
    I have multiple computers on a wired/wireless network, one is a windows XP laptop machine and it sees the Apple TV fine, can sync with itunes works great. This machine is connected via wireless connection. This machine does not have my music or photos that I want to sync so I want to sync the Apple TV with my desktop, I was just using the laptop as a diagnostic tool and to better understand the interaction between itunes and the Apple TV. I have tried all the steps given and still can not get the Apple TV to show up as a device on the desktop.
    I originally had norton firewall on the desktop, uninstalled that so it would not be in the way, did not help. Windows firewall is not enabled.
    I have sharing enabled in itunes and I have look for Apple TVs enabled. I have rebooted the router, Apple TV, computers etc. Reinstalled itunes.
    I have a linksys wreless router in the system. I have tried connectnig the desktop via a wired connection as well as a wireless connection, no difference. The Apple TV can get on the wireless network fine, it can access the internet fine to play movie trailer etc. I have also connected it directly to the router via a cable, does not help. I tried connecting the desktop to the Apple TV directly with a crossed ethernet cable, did not work.
    The desktop can ping the Apple TV.
    I am assuming I do not have a problem with ports as the laptop sees the Apple TV fine?
    Any suggestions or tips would be greatly appreciated

    Welcome to the Apple Discussion Forums.
    To summarise and for clarity: You have set up your laptop itunes library and it works as it should with the tv, now you are trying to add your desktop and it doesn't see the tv.
    First point: the Laptop is your primary library, you can only have one primary library and if you wish to sync from the desktop you will need to make that your primary library instead of the laptop. You will need to turn of syncing for the laptop and register the desktop with the tv for syncing first and then the laptop as a secondary (streaming only) library. If you are trying to use your desktop without de-registering the laptop it will only ever be a secondary (streaming) library.
    You may have realised this and if so all well and good, but if not you might want to continue to establish your desktop as a secondary library and satisfy yourself that all is well before turning off your laptop and setting everything up again.
    On the assumption you are setting up the desktop as a secondary library at this time, how far have you got with registering the desktop, have you successfully entered the pass codes, did the tv show in the device list at any stage. As a secondary library itunes will only show the tv in it's device list when that itunes library is selected as the source library from the tv itself, could this be why you are unable to see it in the device list.

  • My apps do not show up on purchased list on the iPhone!

    My apps do not show up on purchased list on the iPhone even I see them on iTunes store apps. That happened after that I changed my Appple ID email adress.
    What is the soluton for that problem?

    Go to Settings/iTunes & App Stores and sign out. Then sign in with your new Apple email ID.

  • Items on ipod that do not show up on Device list, want to remove them

    A pod cast and a video I downloaded from itunes and copied to my ipod are on my ipod but when I connect the ipod they do not show up on the lists of items on the device. I can see and play them on the ipod, but cannot find them on the list of items on the ipod when I connect to itunes...
    I want to remove them and can't
    baffled....

    They should be able to help you. You must have the iPod set to manually managed. Podcasts generally work best when set to auto-sync.
    To find these files it is easiest to create a smart playlist on the iPod itself with the right rules to find the files while it is set to manually manage. To delete files through a smart playlist you will need to hold the "Alt" key on the keyboard then hit the Delete key. Atl/Delete is for Mac but may be a combination of Delete and Shift, Control, or Windows key on Windows PCs.

  • Can't download plug in for windows media player. Have used download site and it says it worked, but plug in is not showing up on my list of plug ins.

    I tried to hear a conference call on a website. Got a message, needed windows media plug in. Checked my plug ins, no windows media. Read tutorial on firefox support. Clicked on download. Got a window that asked for repair or change. Tried repair, then change. Need better directions on how to finish download. Got message download successful, but after closing firefox and reopening, still no plug in for windows media in list of plug ins. Went to site and could not hear conference.
    Read support forum. Message about using about:config. Tried this, typed in about: config in start menu, but didn't see anything that looked like I could change to true like message said.
    solved by opening internet explorer and going to website and listening to conference call on windows media player. There was a message saying click here if you want to enable media player. Did so, heard conference.
    Tried using chrome. Got to hear conference yesterday. Today, there was same message about needing plug in when I tried to follow instructions to get plug in, it was as confusing and useless as firefox. The bottom line is I tried to do everything set forth in firefox's forum suggestions and can't get the windown media plug in to show up in my list of plug ins and can't hear conference calls on firefox.
    Chrome did say they were working on getting plug in available at chrome store.
    I agree with comments that I was able to go to web sites and hear calls before firefox made an update that removed my windows media plug in. The simple download fix, presumeably from windows, does not work, apparently because firefox can't find the fix. That is not the user's fault, and it looks like windows tried to provide a fix, and firefox won't recognize it.
    Bottom line, it is easier to use another browser, than try and get the windows media player plug in installed on firefox. What good is a browser, if you can't hear a call on the website that the browser takes you to? Please make it easy to install the windows media plug in on firefox. Thank you..

    Firefox can find plugins in several locations, but Firefox 21 changed the location of the "shared" plugin folder so older installers like the Microsoft Windows Media Plugin no longer drop the DLL file in the correct location.
    There apparently are two ways to address this:
    (1) Change a Firefox preference so that Firefox checks the old location. Here's how:
    (i) In a new tab, type or paste '''about:config''' in the address bar and press Enter. Click the button promising to be careful.
    (ii) In the filter box, type or paste '''plugins''' and pause while the list is filtered
    (iii) Double-click '''plugins.load_appdir_plugins''' to switch its value from false to true.
    This will take effect after you restart Firefox.
    (2) Copy the plugins folder to the new location. Here's how on Win 7 64-bit:
    Open a Windows Explorer window to:
    C:\Program Files (x86)\Mozilla Firefox
    Right-click and copy the '''Plugins''' folder
    Double-click the '''browser''' folder to open it
    Right-click and paste
    Right-click the new copy of '''Plugins''' and rename it to '''plugins'''
    After restarting Firefox, the plugins in that folder should now be available.
    ''Edit: I suggest just doing #1.''

  • Command is not showing in to the list on pressing menu button on the device

    Hi Everyone,
    I have developed a midlet in which I have designed buttons or links using Custom Items. Command associated with the custom item is not showing in to the list on pressing menu button on the device 8300 Curve.
    For example - My login screen have SUBMIT and RESET custom items. I have designed them to be appear like links [no matter how I design them]. I have also added a command and listener to it like as below:
    CMD_SUBMIT = new Command(text, Command.ITEM, 1);
    setDefaultCommand(CMD_SUBMIT);
    setItemCommandListener(this);
    On running the midlet, my login screen appears. But when I travarse to the SUBMIT item, and press the menu button, my command doesnt appear in the list of commands. It shows only the Close command. I am not getting why this is happening.
    Please do me a favour and help me to sort out this. On other phones like 8520 curve the command is appearing in to the list when I press the menu button.
    Regards

    Is there any way to sort out this issue? I am not getting the cause
    behind this, and I am observing this only on 8300 Curve. On most of
    there phones [though not tested on every one] it is working as expected.
    Please guide me to proceed further. I am desperately waiting for the
    response. Regards.

  • TS3276 I created a new mailbox in mail, but it does not show up in my list

    I created a new mailbox in mail, but it does not show up in my list of mailboxes. Now I cannot change it or delete it. I keep getting an error message that I must resolve conflicts, but it won't let me change anything.  Can you help me fix this?

    Found it, thanks to the answer Vixen-of-Venus gave - thanks.

  • Since I updated to Mountain Lion I can't print to my Epson NX430 from my Mac. Though it prints fine from my iPad. Suggestions? I have already uninstalled and reinstalled software. It won't show up on my list of printer options.

    My printer is showing no errors and printed fine from my iPad, but it will not connect wirelessly to my mac mini.  When I would try to print the printer status would remain at "idle" and the print queue would give an error message saying no printer was connected to the network.  I searched for a driver update and couldn't find one so I decided to uninstall the software and then reinstall.  I have done this and now the printer will not show up on the list where it should be to even install it durint set up.  What can I do to resolve this issue?

    add the printer IP without the HTTP
    "192.168.1.x:"

  • I read the article on how to remove Bing; however, it does not show up on my list of installed programs and it does not show up in the list of extenstions under "Tools" and "Addon" yet it is installed as an extention to the right of the addlress line.

    I read the article on how to remove Bing; however, it does not show up on my list of installed programs and it does not show up in the list of extenstions under "Tools" and "Addon" yet it is installed as an extention to the right of the addlress line. It is not my home page. Help!!!

    See also:
    *https://support.mozilla.com/kb/Removing+the+Search+Helper+Extension+and+Bing+Bar
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes
    *http://kb.mozillazine.org/Resetting_preferences

  • Bonjour printer not showing up in Printer List

    I am having trouble adding a bonjour printer (HP PSC 1610). The printer is not showing up in the list of printers under System Preferences > Print & Fax. I was able to add the printer by clicking on the "+" sign. It found the bonjour printer and I clicked "Add." Everything seemed fine, but the printer is not showing up in the list of available printers.
    When I'm in Printer Setup Utility, the Printer shows up when I click View > Show Printer List. I just can't select it when I'm in an application and trying to print.
    I can print to the printer from my G5 which still has OS 10.3.9.
    MacBook Pro 1.83   Mac OS X (10.4.7)  

    I think the reason you haven't got responses is that no one has experience with that. Here are some generic troubleshooting steps to try, one at a time:
    Repair permissions (Disk Utility).
    Delete Print Prefs - search for (File>Find) files that start with com.apple.print and delete them all and reboot.
    Reset Printing System (new in Tiger) - In Printer Setup, click this menu item found just above Quit Printer Setup.
    If there is a downloadable Combination Updater from Apple, use it to re-Update OS X.
    Try Printer Setup Repair from www.fixamac.net.
    Use a Disk Utility like Disk Warrior to repair the HD.

  • In iphone 4 mobile me calander not showing all events in list view

    i have iphone 4 Mobile me calendar not showing all events in list view where as showing all events in month/day view. why so & how to resolve

    It started about a week ago. The "From" drop-dow is now missing in Mac Mail. It should appear beneath the subject line. I was working with MobileMe Chat support for about 3 hours. They cannot solve the problem and have now escalated it to the "Senior Advisor Team."

  • Ipod Not Showing Up In The List In Itunes

    Hey, ive had problems with my ipod lately. basically when ever i plug my ipod into my computer, it appears in mycomputer and itunes also opens. i have run the diagnostic in the help menu in itunes and it is detecting my ipod HOWEVER it will not show up in the list on the right hand side!!!! I have tried all the things suggested by apple such as reinstalling and many other things like ending the process etc. no luck.. plz help!

    Have you tried simply resetting hte ipod while it's connected to the PC?
    If that doesn't help, here is an article with a long list of other stuff to investigate.
    http://support.apple.com/kb/TS1369
    You need to expand each link and read all the stuff. For example, under
    "Connect iPod to a high-powered USB port"
    the 4th line down says
    +If the issue persists, try disconnecting other USB devices from the computer such as printers, cameras, scanners, external hard drives, and USB hubs to determine if there is a conflict in the USB chain.+
    That is a step you wouldn't want to skip, as it can really narrow things down.

Maybe you are looking for

  • PPC & Intel backing up on the same hard drive?

    Hi alll. I´ve been using time Machine with my iMac G5 for several months without a glitch on an external USB HD. Now my wife bought a new iMac 20" and we want to use the same USB HD for her backups as well. Here´s what I did so far: I partitioned the

  • How do you add a video on i-pod after you set it to manual

    How do you add a video on i-pod after you set it to manual and not erase a ton of stuff in the process? Thanks

  • Which is better for business Mail or Entourage 2008?

    I am new to Mac. Any advice on the better app for emails & business? does Mail use mbox? where does it store the email files? Thanks a lot in advance...

  • How to config helo in ims5.2

    hi how to config helo in ims5.2 and how to check the output of helo? thanks

  • Click on an icon in the Dock

    I can use this script to click on something on the Dock tell application "System Events" to tell process "Dock" to tell list 1 to click UI element "App Store" is there a script that can do the same thing without having to have "Enable Access for assi