JTree + Setting Icon

I have created a JTree that works fine. I wonder If there is a way of changing the tree icon of a specific leaf when I selected (Only that particular leaf). I tried few things with TreeRenderer but the best done was that I managed to change all the leaf.
Thank you for your help.

Use a TreeCellRenderer instead. It has a parameter that tells you whether the cell is selected, so you can assign a different icon based on that parameter.

Similar Messages

  • How to set Icon on MenuItem

    How to set icon on MenuItem, but not in JMenuItem?

    saleemtol003 wrote:
    You are right.It's not possible to set icon on menuItem.
    I am talking about SystemTray in which I added PopupMenu with MenuItem.
    but I need MenuItem with icon.Is there another way to solve this problem?Nope, just because you're adding a PopupMenu to a TrayIcon does not change the fact that MenuItems cannot have icons.

  • Setting Icon to turn on WiFi is greyed out, why?

    Setting Icon to turn on WiFi is greyed out, why?

    See
    https://discussions.apple.com/message/21488384#21488384
    If fault continues, get the iPhone changed.

  • How can we set icon to a tree table

    Hi ADF Experts,
    The below is regarding skinning of af:tree table component.
    How can we set icon to a tree table
    Below is the af:tree component. When I run the application I see all the parent and child nodes as folder icon. My question is how can set a file icon to the elements present inside a parent node.
      <af:treeTable value="#{pageFlowScope.MerchandizeTreeModel.productTreeModel}"
                                      id="tt1" var="row"
                                      rowSelection="multiple"
                                      horizontalGridVisible="false"
                                      verticalGridVisible="false">
                          <f:facet name="nodeStamp">
                            <af:column sortable="false" headerText=""
                                       rowHeader="true" id="c11" width="200">
                     <af:panelGroupLayout id="pgl0">
       <af:image source="/images/folder.png" shortDesc="foldericon"
                                id="i1"/>
                      <af:outputText value="#{row.groceryItems}" id="ot11"/>
    </af:panelGroupLayout>
                            </af:column>
                          </f:facet>
                        </af:treeTable>
    Thanks in advance,
    Animesh

    Hi Experts,
    I am having a tree table component in adf. I have set a folder image for the parent node. How can we set a document image for contents inside a parent node.
    Thanks,
    Biswa

  • Setting icon to dialog

    Hi all,
    Can we able to set icon in the title bar of the JDialog?
    Waiting for replies...........

    http://www.google.com/search?hl=en&q=Java+%2B+JDialog+%2B+setIcon
    Follow the bouncing link.
    PS.

  • Setting icon for MII version 12.1.x custom action

    Hi,
    i tryed to set icon image for custom action for MII version 12.1.x but i did not achieve.
    How can it be done?
    Thanks.

    Hello,
    I have done it in 11.5. This is how I did it in 11.5. (I am hoping that it has not changed in 12.1)
    //funciton for specifying icon
    public String GetIconPath() {
            return "com/path/to/icons/imagename.png";
    Store your image file in the following way
    com/path/to/icons and name that as imagename.png
    There is also a blog on it
    /people/rupesh.bajaj/blog/2007/12/04/beginners-guide-to-create-custom-action-block
    I hope it helps.
    Regards,
    Musarrat
    Edited by: Musarrat Husain on May 17, 2011 12:18 PM

  • HT5137 i tried using the setting icon to reset the prints and icon to a bigger size, thereafter the setting icon lost colore to gray and stopped responding

    i tried using the setting icon to reset the prints and icon to a bigger size, thereafter the setting icon lost color to gray and stopped responding.? most of the pop up boxes will also not respond why?

    Thanks Winston, restarting my router worked for me too. Seems that somehow the DCHP (maybe due to the Mountain Lion upgrade?) had assigned the same IP address to both the AppleTV and my iMac. The AppleTV stopped appearing as an AirPlay device for my iPhone and Mac, but still the AppleTV had Internet access.
    Restarting the router reassigned IPs and without fanfare, the AppleTV is now available to AirPlay.

  • My iPad setting icon is missing how can I retrieve it?

    I cannot find the setting icon of my iPad. I've tried everything, the push the sleep button and the other button thingy on the same time for 10-15 secs... It doesn't work at all. What should I do?

    If the above doesn't work, try reset all settings
    Settings>General>Reset>Reset All Settings
    Note: Data will not be affected but settings for Wi-Fi, FaceTime, Message, Home Sharing, Wall Paper, Sound etc will be reset

  • I have a notification on the setting icon

    Hi
    I have a notification that is shoing on the setting icon / apllecation and I don't know if there is something wrong with the seeting, and I go throw all the seeting but the notification won't go .
    So can someone help to delete it or fix it Please .
    thank you in regards

    Hi I have the same problem, I have recently got the iphone 4s and had all my information restored from my old phone and now I have the notifcation on the settings button.
    I have updated all the software and even tried resetting the phone it still doesnt work.
    Can anyone help ? Its annoying to see the red 1 on my settings icon.
    Thanks

  • Red alert shown on setting icon

    just done from the new update,after the systems reboot automatically still red alert shown on setting icon??? please advice

    It could be a carrier update.  Those would show up in settings as well.
    iOS: Updating your carrier settings

  • Set Icon in RPD

    Hi,
    Am using OBIEE 11.1.1.6 RPD. I would like to add few more images to the current pool of images that is displayed when we select *"Set Icon"* for Presentation objects.
    I could find .png files on drive (after running search), but not able to find how the images have been called into 'Select Icon' box in RPD.
    Any Help?
    Regards,
    Jitendra

    Cool, thanks balus, there's a good bit of info about favicon out there on the interweb.
    Cheers,
    Illu

  • How can I get the setting icon back after upgrading to ios 7 on ipod

    I am going round in circles.  I can't get to Settings to fix anything because the Setting icon is not showing.  What can I do?

    Opps, I forgot that.
    Have you tried using the Search feature to tru to find Settings?
    Next
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Restore from backup. See:                                 
    iOS: How to back up                                                                
      - Restore to factory settings/new iOS device.

  • No badge alert on setting icon when the new ios update is released

    Hi all,
    I use iphone 5. I found that a badge is not shown on the setting icon when a new ios update is released. Only way letting me know that there is an update is manual check update, i.e. go to setting->general->software update. I think, normally, the badge should present automatically on the setting icon everytime the update is released. Does anyone find this problem? How to solve this?
    Thanks,

    I have the exact same problem. Been searching Google for answers but have found none :-(
    I upgraded from an iPhone 4s to 5 recently. I had the Settings badge show up right after I got the phone, but after I got home and did a restore from backup to get my 4s stuff over to the 5, then no more badge notification.
    I can't find any settings anywhere to help with this.
    Anybody got any suggestions/thoughts/fixes/etc?

  • My setting icon ii not on my home page need to put it back on home page

    my setting icon is not my home page want to put it back

    Easiest way is to use iTunes:
    http://support.apple.com/kb/ht1977

  • How to Set icon/image programatically in ADF before page loads

    This is my UI:
    Depends on the condition i want to set icon/image programatically in my java code.Before page load im calling this method.
    So i couldnt take binding value also,it throws null pointer exception.Then i tried setting icon/image programatically.
    <af:commandImageLink text="settings" icon="#{bean.iconsettings}" binding="#{bean.bind}"> </af:commandImageLink>
    My bean:
    private RichIcon iconsettings;(its getters and setters)
    private void method(){                         // method
    if(cond){
    this.iconsettings="/images/20.jpg";   //trying to set icon in a string.but it throws me error that cannot set RichIcon to string.
    else
    this.iconsettings="/images/19.jpg";
    Could any one tell me how can i set icon/image in java code.Before page loads im performing all above said tasks.Please help.

    Well, you set the icon property to a bean method, which you have done. The bean method however need to have the signature
    public String getIconsetting()
    // your code returning hte path to the icon
    if(cond){
         return ="/images/20.jpg";   //trying to set icon in a string.but it throws me error that cannot set RichIcon to string.
    else {
         return ="/images/19.jpg";
    The bindproperty is not needed, remove it and remove the RichIcon Iconsettings too´as it's not needed to and is the wrong type anyway.
    Timo

Maybe you are looking for