JTree - hidding root when showing the rest of the tree

How can I hide only the root element when displaying the rest of a tree ?

Hi Zauz,
I unterstand your argumentation, but I have a problem with the implementation. Maybe you can show me your answer at a simple example:
DefaultMutableTreeNode root = new DefaultMutableTreeNode("world");
DefaultMutableTreeNode country1 = new DefaultMutableTreeNode("france"); // Chield 1
DefaultMutableTreeNode country2 = new DefaultMutableTreeNode("germany"); //Chield 2
DefaultMutableTreeNode country3 = new DefaultMutableTreeNode("norway"); //Chield 3
DefaultMutableTreeNode town1 = new DefaultMutableTreeNode("Frankfurt");
DefaultMutableTreeNode town2 = new DefaultMutableTreeNode("Berlin");
JTreetree = new JTree(root);
root.add(country1);
root.add(country2);
root.add(country3);
country2.add(town1);
country2.add(town2);
tree.expandRow(2); // 3 countries -1 = 2 children ????
tree.setRootVisible(false); // result 0 tree invisible ???

Similar Messages

  • Cannot Deleted the PDF Files When Show The Preview Pane in Window 8

    Dear Sir / Madam,
    Cannot Deleted the PDF Files When Show The Preview Pane in Window 8.
    Any solution about this issue.
    Why windows 7 do not have faced this issue, but when migration to windows 8 face this issue?
    Regards,
    Alex Tai

    You need to close the preview / document viewer before deleting.
    Arnav Sharma | http://arnavsharma.net/ Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading
    the thread.

  • Safari freezin when show the previous page with gestures

    I'm on a Macbook Pro 13 inch mid 2012
    Processor 2.5 Ghz intel core i5
    memory 4Gb 1600 MHz DDR3
    OSX 10.9.5
    My problem is with Safari 7.1
    it just started to happen with the last upgrade of Safari for a can tell, wen I'm navigating several page or just go to a next pager after the first screen, and wen i use my *Gesture for "Show the previous page" it just slide a bit it alwase the some amount, and it just freeze the action and you can't apparently "stop loading page" o " Reload the current page".
    and i have to closet that actual Tab and load the page i was in.
    it not a big thing bat i think it actually affecting other gestures after the problem triggered and wen i don't notice if it happen it get frustrating if I'm truing to use othere gestures in other window of Safari. have to navigate and find the actual window that got frozen or just close all tabs at one if i don't want go thow the trable of finding it.
    Any ideas what it could be cousin the problem or any solution to it?

    Is there anyway to fix this without changing my operating system?
    I didn't think there was, but my memory is a bit rusty.
    Safari 1.3.2 is a bit rough around the edges these days unfortunately.
    Your best bet these days is to switch to an alternative browser that is still fully supported on Panther, such as:
    Camino
    Firefox
    Sorry, I wish I had better news for the Safari side of things

  • Catalog manager not showing the tree view

    Hey Everyone
    I cannot see the tree view when i login in the catalog manger in the online mode.What could be the reason? I can see only the \ folder but not the shared,system and users folders.I checked even the instance config file and made sure the path was right.
    Thanks

    what does emctl status dbconsole show?
    Hi All,
    I have installed 10g in Win 2000. Enterprise manager
    was working fine after installation. I restarted the
    Oracle Service (DB Service, TNS, iSQL, DBControl)
    from services in Control Panel. Database is up and
    working fine but the Enterprise Manager is not
    working. When I am trying to use the EM through
    Internet Explorer, it is not asking for any login and
    showing as database as down. I am able to connect to
    DB from client PC. Please advice.

  • Jdeveloper error when showing the BPEL diag

    I am getting the below error in Jdeveloper when looking at the BPEL visual diag and cannot able to view the diagrams properly. The source code looks fine
    Uncaught exception
    java.lang.NoClassDefFoundError: oracle/tip/tools/ide/bpel/v2/plugins/plugins/monitor/xbean/model/MonitorModelDocument$Factory
    o.tip.tools.ide.bpel.v2.plugins.plugins.monitor.model.MonitorModel.load(MonitorModel.java:113)
    o.tip.tools.ide.bpel.v2.plugins.plugins.monitor.plugin.perspective.MonitorPerspective.loadMonitorModel(MonitorPerspective.java:112)
    o.tip.tools.ide.bpel.v2.plugins.plugins.monitor.plugin.perspective.MonitorPerspective.loadModel(MonitorPerspective.java:62)
    o.tip.tools.ide.bpel.v2.designer.addin.view.PerspectivesPanel$1.run(PerspectivesPanel.java:204)
    j.lang.Thread.run(Thread.java:662)
    Caused by:
    oracle.classloader.util.AnnotatedClassNotFoundException:
         Missing class: oracle.tip.tools.ide.bpel.v2.plugins.plugins.monitor.xbean.model.MonitorModelDocument$Factory
         Dependent class: oracle.tip.tools.ide.bpel.v2.plugins.plugins.monitor.model.MonitorModel
         Loader: ide-global:11.1.1.0.0
         Code-Source: /C:/Users/u25341/Documents/JdevMiddle/jdeveloper/jdev/extensions/oracle.bpel.v2.designer.plugins.jar
         Configuration: extension jar in C:\Users\u25341\Documents\JdevMiddle\jdeveloper\jdev\extensions
    This load was initiated at ide-global:11.1.1.0.0 using the loadClass() method.

    Hi,
    close Jdev, remove all bar one of the lruFiles item nodes in preferences.xml in \JDevHome10.1.3.1\system\oracle.ide.10.1.3.39.84
    (note i am using 10.1.3.1)
    when you are finished it should look something like this:
    <lruFiles>
                <Item class="oracle.ide.editor.RecentFile">
                   <editor>oracle.jdevimpl.help.HelpSystemAddin</editor>
                   <explicit>false</explicit>
                   <nodeURL path="../../../jdevstudio10131/jdev/doc/ohj/bc4jjavadoc.jar" jar-entry="oracle/jbo/server/ViewObjectImpl.html.help"/>
                   <projectURL/>
                   <workspaceURL/>
                </Item>
    </lruFiles>restard Jdev
    this has worked for me for this specific error a few times.
    Brenden

  • Speedgrade crashes when showing the analysis tools.

    I can make edits and changes to grades and effects just fine. But as soon as I click the arrow to open the analysis tools, the application crashes. This is extremely frustrating as I need the scopes to do anything in SG.
    I have attempted to lower preview resolution, scopes resolution, GPU acceleration on and off. I have uninstalled twice.
    Machine info:
    Windows 7
    amd fx 8350
    32gb ram
    2x GTX 770s SLI
    Footage stored on internal SSD

    Same here.
    I can work all day in SG no problems. As soon as I click the arrow to bring up the scopes *crash*. This is post cleanup SOP.
    AMD 3820 @ 3.5GHz
    16GB RAM (11GB dedicated to Adobe)
    Asus Nvidia GTX760-DC2 2GB
    Win 8.1 (all updates current today)
    Speedgrade 8.2x51 Native access (no hyperlink from PP)
    GPU Acceleration enabled via CUDA
    No plug-ins for SG or PP
    Error log as follows:
    Problem Event Name:
    APPCRASH
      Application Name:
    SpeedGrade.exe
      Application Version:
    8.2.0.0
      Application Timestamp:
    54887476
      Fault Module Name:
    SpeedGrade.exe
      Fault Module Version:
    8.2.0.0
      Fault Module Timestamp:
    54887476
      Exception Code:
    c0000005
      Exception Offset:
    00000000003ee03f
      OS Version:
    6.3.9600.2.0.0.256.48
      Locale ID:
    1033
      Additional Information 1:
    d236
      Additional Information 2:
    d236bbe002996cedee0dde381fa38db4
      Additional Information 3:
    c93f
      Additional Information 4:
    c93ffbb2a38ecaab8d72a49f5c39cc59

  • Left to right alingment issue when showing the report in arabic language

    Hi,
    Now am working in Arabic reports, Everything working fine, but the problem is with the alignment only.
    In development of report (report builder) the alignment is right to left but in pdf the alignment changed to left to right.
    I am using Oracle Report Builder 10.1.2.0.2 and running reports on Oracle Application server 10.1.2.0.2
    Can anyone help me this.
    Regards,
    Iftikhar

    Installed the Oracle Forms and reports services 10g/ Oracle application server 10g (10.1.2.0.2) with Arabic Language and got the problem resolved.

  • PE4 - Organiser Folder View shows the tree twice

    My photos are stored in C:\documents and settings\user\my photos. (Win XP Pro) When I use Folder view in PE4 organiser it shows two trees:
    C:\my documents and settings\user\my photos and then under that a new tree
    "My documents and settings\user\my photos".
    Both trees take me to the same folder my photos. Its very confusing for someone not used to it.
    How can I remove one of the two trees from view? I have tried hiding and also removing but both appear to be default

    I have the same problem and assumed it has something to do with how I "added" the watch folder.
    I am going to play and see if that's the problem.

  • JTree: how not to render the "tree connecting lines"

    I have a JTree.
    I would like that my custom tree renderer (using windows LAF) did not paint the dotted line that connect the hierarchy nodes. setting the icon to null in the default renderer only do not paint the folder. How can I disable also the painting of the dotted line?
    using
    tree.putClientProperty("JTree.lineStyle", "None")
    I disable it for the whole tree.
    First of all this do not work on Windows LAF. Then I'd like to disable only on certain branches or nodes, that are somehow as "empty containers", while keeping hte default feature for the "good branches".
    any idea?
    thanks
    Edited by: Davide_Gesino on Nov 8, 2009 5:24 AM

    hii,
    one from possible:
    tree.putClientProperty("JTree.lineStyle", "Horizontal"); a lots examples (runnable) at http://www.java2s.com/Code/Java/Swing-JFC/Tree.htm
    ... kopik

  • Can I hide certain folders from the 'tree view' under Site Manager - Pages?

    In the above image, is there a way to hide the circled folders from the listing?
    This will help in reducing confusion and possible breakages.

    Hi AirborneAgency,
    unfortunately there is not, educate the admins of this site not to touch these folders instead. That's what I do with my clients and it works just fine.
    Nicole - BCGurus.com   |  http://bcgurus.com/Business-Catalyst-Templates for only $7

  • How to create JTree without root node

    Hello;
    I like to create a JTree without root node?
    Any help?
    Thanks!
    --tony                                                                                                                                                                                   

    javadocs JTree,
    setRootVisible
    public void setRootVisible(boolean rootVisible)
    Determines whether or not the root node from the TreeModel is visible.
    Parameters:
    rootVisible - true if the root node of the tree is to be displayedSee Also:
    rootVisible

  • BT Mail Error Message: An error occurred when show...

    I login (successfully) to BT Broadbaand.  
    I select BT Mail  
    I select my Inbox  
    After a 'Please wait...' message I get an error message:
    An error occurred when showing the email list
    Error with email list.
    [OK] [Retry]
    So, I can't read any of my Inbox emails. This is serious; I cannot afford to not receive emails promptly.
    Can anyone advise, please?
    Solved!
    Go to Solution.

    Thanks, but as you say, I'm struggling with Windows Live Mail issues. I've been using Firefox all along, since well before I moved to BT (on the 13th).
    I'm wondering if this problem is connected, although BT Mail was fine the previous time I was online and I haven't changed a thing since then. Another advisor also suspects a BT Cloud issue is linked to Windows Live Mail.
    I've just removed anything to do with Windows Live Mai from my PC and reset my router, but this email inbox problem is still there.

  • JTree - How to Expand all Nodes in the Tree

    I have a tree that has one primary node, two sub-nodes, and multiple sub-sub-nodes under those. I want to expand (show) all these nodes in the tree when the tree first loads. I tried expandRow() but that only seems to expand one row at a time by entering a single integer for the row. Is there any way to expand all rows/nodes when loading the tree?

    see
    http://forum.java.sun.com/thread.jsp?forum=57&thread=148793

  • With a PDF Dynamic form using show/hide actions, how to ensure that when the completed form is saved, closed and re-opened, the form still show the fields as before it was closed?

    With a PDF Dynamic form using show/hide actions, how to ensure that when the completed form is saved, closed and re-opened, the form still show the fields as before it was closed?
    I have developed a form with fields hidden by default, that become visible based on box ticked or radio button selections.
    My problem is that, when I close the form and re-open it, it comes back to it's default presentation, regardless of the information already recorded in the form (including in the now hidden fields.
    How to correct that
    Thanks in advance for any hint you can provide.

    I've had the same problem. This solved it...
    Go to the "Form properties..." in the File-menu. Select "Run-time" to the left and in the box "Scripting" Preserve scripting changes to form when saved: choose Automatically (Script-based state changes are saved locally in an insecure fashion. This option cannot be used for certified forms).
    Hope it works for you to...

  • In the iDVD window, there is a box in the lower left corner.  When I scroll over it, I get the message to hide or show the intro movie.  Checking or unchecking the box seems to do nothing.  Can anyone explain?

    Working with iDVD on a project, there is a box in the lower left corner and sometimes another in the lower right corner.  Scrolling over the one in the lower left corner, I get a message indicating that this box hides or shows the intro movie.  I have checked and unchecked the box, but see nothing different in the project.  Nor can I figure out what is meant by "intro movie."  Can anyone explain?

    Go to iDVD Help and type in Intro Movie, and you will get the full version of this:
    Many iDVD themes have “motion menus” that include animations or video that loop, or play repeatedly, until the viewer clicks a menu button. Themes with motion menus have a motion icon in the lower-right corner.
    In addition to background video, iDVD motion menus may also feature an intro, or short animation, that plays once before the part that loops. Other motion menus also include an “outro” that plays after the viewer clicks a button, serving as a transition between the menu and the selected content.
    An example of an iDVD 6.0 theme with an intro and an outro is Reflection White Main. In this theme, the first drop zones appear in the intro, and the buttons and title appear just before the looping part of the background video. In the outro, everything flies offscreen after the viewer clicks a button.
    iDVD provides tools for viewing these motion menus without going into preview mode, which is especially helpful when you are filling drop zones, and for turning the intro or outro off.
    Here are ways to view and edit the background movie:
    ◼ 
    Drag the diamond-shaped motion playhead along the scrubber bar (shown below), to view the background movie, stopping wherever you like.
    (If you don’t see the motion playhead in iDVD, choose View > Show Motion Playhead.)
    ◼ 
    Deselect the checkboxes at the left and right end of the scrubber bar if you don’t want to use the intro or outro, respectively, in your DVD menu.
    The scrubber bar shows the intro and outro as shaded areas at the beginning and end.
    You can also control the intro and outro from the Menu Info window. With your pointer over the menu (and with no buttons or text objects selected), press Command-I to open that window. Select or deselect the Intro and Outro checkboxes in the Background section of the window.
    NOTE: If you drag your own movie to a motion menu background, the outro is automatically removed. To customize the background and keep the outro, use a still image in the menu background instead of a movie.

Maybe you are looking for

  • Do Reminders in iCal sync via iTunes?

    I'm using Reminders in iCal 5.0.1 on OS X Lion. I sync my iCal data with the Calendar app on my iPhone, via iTunes (not iCloud). The weird thing is, none of my Reminders data is syncing, either from my iPhone to my iMac, or from my iMac to my iPhone.

  • Drive with Offline Files folder not available for 2 minutes after being connected to the network.

    Hi We use Windows SP1 with one folder from the User HomeDirectory set to be available offline. The problem we encounter is that when going from Offline to Online via VPN, there is a 2 minutes delay for the drive where the offline folder is located to

  • No startup script in TOMCAT 5 ?

    Hey. I'm trying the latest version of TOMCAT but I miss the catalina.bat (I'm using windows) which allows to startup and shutdown the tomcat server. All I'm left with is the tomcat5.exe, but I need a prompt based way to startup and shutdown TOMCAT. A

  • -bash: ulimit: open files: cannot modify limit: Operation not permitted

    Hi all, i´m preparing a linux 64bits environment to install Oracle 10g R2. I´m following the installation manual and there say that: Depending on the oracle user's default shell, make the following changes to the default shell startup file: For the B

  • CRM Survey - How to remove Radio button defaults.

    Hi experts, I am trying to remove Radio button default. By default it is selected when I am trying to set attribute for answer options. Even if I unchecked, it reverts and set as selected again. Actually, I need remove Radio button default for the cu