How do I remove expand / collapse icon for JTree empty folders

Hi
I am using a JTree as a file system browser. I use DefaultMutableTreeNode nodes.
I have a problem with empty folders.
Empty folders show the expand / collapse icon, leading the user to believe there are sub-directories. When the user double-clicks the folder, the expand / collapse icon goes away. This is a "haha-gotcha" glitch that I really don't want my users to have to continually deal with.
So, how might I get my JTree to not show the expand / collapse icon for empty folders?
Thanks
Wayne

Maybe I can use the FileSystemView isTraversable(File f) method in my TreeCellRenderer class to check if anything is in the directory.
But I still need to know how to disable the expand / collapse icon for such a node.

Similar Messages

  • Change behaviour of Expand/collapse icon in JTree

    Want to change the behaviour of Expand/collapse icon in a JTree. Need help with the same. Thanks.

    Check: Hide and show region

  • How do i remove the taskbar icon for a JFrame from a windows taskbar?

    I have an undecorated JFrame (no titlebar, minimize, restore, close buttons) and i want to remove it being shown on the windows taskbar. is there a way in Swing to do this?
    If not is there any other way i can show some content that appears free floating on the desktop and does not show up on the taskbar.

    GauravTaneja wrote:
    Can the JDialog be undecorated? as in i don't want the little close button or the title bar on the dialog. just the content pane to display something.I don't know. Check the API.
    Also, i want this to be on top of all windows.So make it a modal JDialog.

  • How to implement expand/collapse property for custome components

    can any one tell me how to implement the expand/collapse
    property for the custom components in flex. i need something like
    hierarchy of custom components which on the expand should be able
    to show the children of the corresponding component and a line
    linking between them and collapsing property too.. can any one help
    me out..

    "hanu106" <[email protected]> wrote in
    message
    news:gfr2co$biq$[email protected]..
    > can any one tell me how to implement the expand/collapse
    property for the
    > custom components in flex. i need something like
    hierarchy of custom
    > components
    > which on the expand should be able to show the children
    of the
    > corresponding
    > component and a line linking between them and collapsing
    property too..
    > can any
    > one help me out..
    Tree?
    AdvancedDataGrid?
    Nested Acordions

  • How do I remove the "TOC" btn in the playbar WITHOUT removing the TOC "Expand/Collapse" icon?

    I am working in CP7 on a project with a Table of Contents that is set to 'Overlay'. The client has requested that I remove the "TOC" button in the playbar, without removing the TOC "Expand/Collapse" icon, so that the user can still hide/reveal the TOC when necessary. The only control I can find is the "Show TOC" checkbox under Project > Table of Contents. However, un-checking this option removes both the "TOC" button AND the "Expand/Collapse" icons. Is it possible to remove just the "TOC" button in the playbar?

    If you are using SWF output you can always edit the playbar in Flash and remove it.
    If HTML5 you can edit the JavaScript out put to remove the button from the playbar.

  • Remove the expand/collapse image for af:treeTable

    I am showing some data in a treeTable, which some rows will not have any further childs. How can I remove the expand/collapse image for those rows in the component <af:treeTable> ?
    Regards,
    Uday

    Hi,
    according to http://www.oracle.com/technology/products/jdev/htdocs/partners/addins/exchange/jsf/doc/tagdoc/core/treeTable.html you can only hide the expand/hide all link
    Frank

  • Remove/hide expand/collapse icons

    Hi,
    I would like to remove/hide the expand/collapse icons and have a fixed navigation iView.
    Thanks in advance.
    Rgds,
    Janvi

    Hi Janvi,
    Probably to hide the collapse and expand icon you could go about with the theme editor , where u can set the url to these images as some blank image that coincides with ur background colour.
    To have a fixed navigation panel without scrolling ,probably you can change the the width of the navigation panel by changing the value defaultExpWidth in the file WAandNAVPanel.js file in the par file com.sap.layouts.framework.par from 220 pixels to a higher value.Later u need to upload the file back and restart ur system.
    Hope this helps,
    Regards,
    Uma.

  • How to specify different horizontal restore & collapse icon for af|panelSplitter using Skinning based on Style class or position?

    Hello,
    I am trying to provide different horizontal restore & collapse icon for af|panelSplitter using Skinning based on Style class or position. I have 2 af:panelSplitter with orientation="horizontal" - One with positionedFromEnd="true" one with positionedFromEnd="false". I want to specify the horizontal collapse and restore icon using Skinning. I want specify different icons based on positionedFromEnd. When I specify icons they are appearing for both splitters. I gave 2 different styleClass to these splitter but it is not taking them in account,
    JSPX Page -
    <af:panelSplitter orientation="horizontal" splitterPosition="196" positionedFromEnd="false" id="pnlSplitterLeft" collapsed="false" styleClass="panelSplitterLeftClass">
      <f:facet name="first">
      <!-- Content of First Facets -->
      </f:facet>
      <f:facet name="second">
      <af:panelSplitter orientation="horizontal" splitterPosition="196" positionedFromEnd="true" id="pnlSplitterRight" collapsed="false" styleClass="panelSplitterRighClass">
      <f:facet name="first">
      <!-- Content of First Facets -->
      </f:facet>
      <f:facet name="second">
      <!-- Content of First Facets -->
      </f:facet>
      </af:panelSplitter>
      </f:facet>
    </af:panelSplitter>
    CSS Skinn
    af|panelSplitter::horizontal-restore-icon {
        width: 10px;
        height: 55px ;
        content : url("/skins/AppSkin/Left_Open.gif");
    af|panelSplitter::horizontal-collapse-icon {
        width: 10px;
        height: 55px ;
        content : url("/skins/AppSkin/Left_Close.gif");
    af|panelSplitter.panelSplitterLeftClass::horizontal-restore-icon {
        width: 10px;
        height: 55px ;
        content : url("/skins/AppSkin/Left_Open.gif");
    af|panelSplitter.panelSplitterLeftClass::horizontal-collapse-icon {
        width: 10px;
        height: 55px ;
        content : url("/skins/AppSkin/Left_Close.gif");
    af|panelSplitter.panelSplitterRighClass::horizontal-restore-icon {
        width: 10px;
        height: 55px ;
        content : url("/skins/AppSkin/Right_Open.gif");
    af|panelSplitter.panelSplitterRighClass::horizontal-collapse-icon {
        width: 10px;
        height: 55px ;
        content : url("/skins/AppSkin/Right_Close.gif");
    It is always showing Left_Open.gif and Left_Close.gif for both splitters. But I want different image.
    How to specify different horizontal restore & collapse icon for af|panelSplitter using Skinning based on Style class or position?
    - Sujay

    CSS attribute selectors are what you are talking about, but binding the selector with EL is a more-common approach. Using selectors like this require you to ensure browser support.
    af|panelSplitter.panelSplitterRighClass::horizontal-collapse-icon [positionedFromEnd=true]

  • JTree remove expand/collapse cross button...??

    Hi all,
    I have forbidden tree collapsing (by default it is fully expanded),
    and I want to remove expand/collapse cross buttons that actually are used to expand/collapse tree nodes.
    Is it possible and can anyone give me advice how i can do this.
    Thanks in advance.

    I tried extending the BasicTreeUI to return nulls for the collapsed and exapnded icons as shown in the code below. For the most part, it works great! However, one can still expand/collapse the tree by clicking on the point where the vertical and horizontal lines connect.
    I guess some one else will take over from here.
    import java.awt.BorderLayout;
    import javax.swing.Icon;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTree;
    import javax.swing.WindowConstants;
    import javax.swing.plaf.basic.BasicTreeUI;
    import javax.swing.tree.DefaultMutableTreeNode;
    public class Temp extends JFrame {
         private JTree tree = null;
         public Temp() {
              super("Test");
              setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
              initComponents();
              pack();
              setVisible(true);
         private void initComponents() {
              DefaultMutableTreeNode rootNode =
                   new DefaultMutableTreeNode("User Preferences", true);
              DefaultMutableTreeNode connectionSettingsNode =
                   new DefaultMutableTreeNode("Connection Settings", true);
              DefaultMutableTreeNode sslNode =
                   new DefaultMutableTreeNode("SSL", false);
              DefaultMutableTreeNode firewallNode =
                   new DefaultMutableTreeNode("Firewall", false);
              DefaultMutableTreeNode securityNode =
                   new DefaultMutableTreeNode("Security", true);
              DefaultMutableTreeNode serverCertificatesNode =
                   new DefaultMutableTreeNode("Server Certificates", false);
              DefaultMutableTreeNode clientCertificatesNode =
                   new DefaultMutableTreeNode("Client Certificates", false);
              connectionSettingsNode.add(sslNode);
              connectionSettingsNode.add(firewallNode);
              securityNode.add(serverCertificatesNode);
              securityNode.add(clientCertificatesNode);
              rootNode.add(connectionSettingsNode);
              rootNode.add(securityNode);
              tree = new JTree(rootNode);
              JScrollPane scroller = new JScrollPane(tree);
              getContentPane().add(scroller, BorderLayout.CENTER);
              tree.setUI(new MyTreeUI());
              //tree.setShowsRootHandles(false);
         public static void main(String args []) {
              new Temp();
         class MyTreeUI extends BasicTreeUI {
              public Icon getCollapsedIcon() {
                   return null;
              public Icon getExpandedIcon() {
                   return null;
    }Sai Pullabhotla

  • How can I remove the Yahoo icon from my iphone?

    How can I remove the Yahoo icon from my iphone?

    This is covered in the manual.
    iPhone User Guide (For iOS 4.2 and 4.3 Software)
    Hold an icon until they all wiggle, then tap the "x" in the corner.

  • How do you remove deleted apps icons in App Store in purchased area?

    How do you remove deleted apps icons in App Store in purchased area?

    You can't permanently delete any items from your purchase history, but you should be able to hide them from the Purchased tab via your computer's iTunes : http://support.apple.com/kb/HT4919
    If your iPad is on iOS 7 then after hiding them on your computer you may need to log out of your account on your iPad by tapping on your id in Settings > iTunes & App Store and then log back in for them to be hidden from the Purchased tab

  • How do you remove the Messages icon from iPad.

    How can I remove the Messages icon from iPad.

    The preinstalled apps cannot be deleted. You can move it into a folder and place the folder on another screen if you don't want to use the app or see the icon.
    Tap and hold down on the icon until it begins wiggling and then drag the wiggling icon on top of another icon - any other app that you do not want to use would be ideal - and that will create a folder. Name the folder whatever you like. Tap anywhere outside of the folder to close it.
    While the folder and icons are still wiggling - drag the folder over to the edge of the screen - about halfway over - and just hold it there for a second or so and it will jump over to the next screen. When you are done - Tap the home button to stop the apps from wiggling.

  • How do you remove face tagging icon from images.  I cannot get them off some images.

    How do you remove face tagging icon from images.  I cannot get them off!  This is for adobe photoshop elements 6.   Thanks

    The links below have instructions for deleting photos.
    iOS and iPod: Syncing photos using iTunes
    http://support.apple.com/kb/HT4236
    iPad Tip: How to Delete Photos from Your iPad in the Photos App
    http://ipadacademy.com/2011/08/ipad-tip-how-to-delete-photos-from-your-ipad-in-t he-photos-app
    Another Way to Quickly Delete Photos from Your iPad (Mac Only)
    http://ipadacademy.com/2011/09/another-way-to-quickly-delete-photos-from-your-ip ad-mac-only
    How to Delete Photos from iPad
    http://www.wondershare.com/apple-idevice/how-to-delete-photos-from-ipad.html
    How to: Batch Delete Photos on the iPad
    http://www.lifeisaprayer.com/blog/2010/how-batch-delete-photos-ipad
    (With iOS 5.1, use 2 fingers)
    How to Delete Photos from iCloud’s Photo Stream
    http://www.cultofmac.com/124235/how-to-delete-photos-from-iclouds-photo-stream/
     Cheers, Tom

  • ADOBE DIGITAL EDITIONS: How do I delete a duplicate icon (for a book)

    Adobe digital editions -  how do i delete a duplicate icon (for a book)

    you will get the option to delete the icon only if its user installed. other wise you will have to sync using itunes on pc to remove apps.
    follow the link for syncing
    http://support.apple.com/kb/HT1386

  • How can I remove the "Notifications" icon from the Menu Bar in OS 10.9?

    How can I remove the "Notifications" icon from the Menu Bar in OS 10.9?

    As far as I can tell, this is your best option: http://reviews.cnet.com/8301-13727_7-57608829-263/how-to-turn-off-notification-c enter-in-os-x-mavericks/

Maybe you are looking for

  • How Itunes 7.0 killed my ipod 60g photo

    Here is a sad story for others benefit. I am out of luck! as my ipod is 13 months old and out of warranty... and nothing seems to work. [I am hoping for some tech master on these forums who can help] 1. I had a perfectly working ipod (No issues) Whic

  • Xorg7: fglrx drivers fails with modprobe

    Arch installed three days ago from ISO Noodle (after a crash of an old HD), have been actualised up today with xorg7. ATI Radeon 7200LE card is correctly recognised by lshwd as Radeon QD using driver 'vesa', but a display in X flitters in comparison

  • Do I have to use WiFi to watch Amazon instant movies, or can I use 3G?

    I'm staying in a hotel with very slow WiFi, and I'd like to watch movies from Amazon on my iPad 2.  WIth WiFi, the movie buffers every few seconds, but when I try to watch using Verizon 3G, I get a message that I have to use WiFi. I'd appreciate any

  • Procedure calls in submit order

    Hi, I have a web front that can call in a background process at any time a procedure that takes about 20sec to complete. From the front end I can get this procedure call 3 or more times in 20sec. What I want to achieve is to execute these calls in th

  • HT5085 my i phone is disabled how do i fix it

    my phone is disabled how can i fix it