How do i get to display the nodes under the root node in a JTree?

In my JTree there is a root node.This root node has 4 child nodes.Each child node in turn has nodes under it.What i need to do is just display the child nodes under the root node i.e., the four child nodes and keep these child nodes in a collapsed state.How do i go sbout this?

Please try this:
tree.expandRow(0);
SwingUtilities.invokeLater(new Runnable(){
    public void run(){
        tree.setRootVisible(false);
});If you want to show the RootHandles:
tree.setShowsRootHandles(true);If you want to keep nodes in collapsed state (not expandable):
        tel = new TreeWillExpandListener() {
            public void treeWillExpand(TreeExpansionEvent event) throws ExpandVetoException {
                throw new ExpandVetoException( event, "Don't want" );
            public void treeWillCollapse(TreeExpansionEvent event) throws ExpandVetoException {
        tree.addTreeWillExpandListener(tel);Some reading material:
http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html
http://java.sun.com/docs/books/tutorial/uiswing/events/treewillexpandlistener.html
Edited by: Andre_Uhres on Nov 14, 2007 5:17 PM
Edited by: Andre_Uhres on Nov 14, 2007 5:33 PM
Edited by: Andre_Uhres on Nov 14, 2007 5:39 PM

Similar Messages

  • I had to reset my Apple password and now my iTunes and iCloud passwords no longer work. How do I get them linked again and under the same password. I've tried my new password on each login screen and it isn't accepted.

    I had to reset my Apple password and now my iTunes and iCloud passwords no longer work. How do I get them linked again and under the same password. I've tried my new password on each login screen and it isn't accepted.

    Hi skippy2012trev,
    Welcome to the Apple Support Communities!
    I understand that you updated your Apple Id and password but now you are being prompted for the old information in iCloud. You are on the right track by changing the Apple ID back to the previous email address temporarily so that you can sign out. You should not need to verify the email address. After you edit the Apple ID back to the old email address and then sign out of iCloud on your iPhone, edit the Apple ID back to the address you would currently like to use. There is no need to change the password again, only the email address, unless you prefer to update the password again.
    If you're asked for the password to your previous Apple ID when signing out of iCloud - Apple Support
    Change your Apple ID temporarily
    If signing out and back in to iMessage or FaceTime didn't help, try these steps:
    Change your Apple ID to the Apple ID you used previously. You shouldn't need to verify the email address.
    Tap Settings > iCloud. Complete these steps only if the Find My [Device] setting is turned on:
    Scroll down and tap Sign Out, then tap Sign Out to confirm. If you're using iOS 7 or earlier, tap Delete Account, then tap Delete to confirm.
    Tap Keep on My [Device] or Delete from My [Device]. In either case, your data remains in iCloud and will be updated on your device when you sign in to iCloud again.
    Enter the password for your previous Apple ID.
    Change your Apple ID to the new email address that you want to use. You'll need to verify the email address.
    Return to Settings > iCloud and sign in with your new Apple ID.
    Cheers,
    Joe

  • So I recently bought 3 new songs, and they won'y show up on my main iTunes Library page or under the artist, but they show up under purchased.  How can I get them to show up under the artist/ main library page?

    So I recently bought 3 new songs, and they won'y show up on my main iTunes Library page or under the artist, but they show up under purchased.  How can I get them to show up under the artist/ main library page?

    Logging out of itunes store and logging in again has worked for some people

  • I have an Apple Powerbook G4, and my monitor doesn't function. I have an external display Monitor, however it's stuck in extended screen mode. How do I get it to mirror or duplicate the display without use of the on-board?

    As i had said, I have an Apple Powerbook G4, and my monitor doesn't function. I have an external display Monitor, however it's stuck in extended screen mode. How do I get it to mirror or duplicate the display without use of the on-board? Is there a Fn key combo i'm missing or is the issue more serious then i realize? any and all help and hints would be greatly apprichiated, thanks in advance.
    -Powerbook User

    The PowerBooks have an F-key that toggles mirrored and extended mode. My PB is loaned out right now but I think it was f7. The keycap has an icon on two overlapping rectangles, as I recall.
    EDIT: Yes! Found a pdf of the PB manual it shows F7 is the toggle:

  • Aperture trash is not displaying items in trash.  I want to get a number items out of trash.  How do I get them displayed or is there another  way  to put them back in the file?

    Aperture trash is not displaying items in trash.  I want to get a number items out of trash.  How do I get them displayed or is there another  way  to put them back in the file?

    See Why can't I see my deleted photos in Trash?

  • How do you get word count to print at the end of a document in Pages?

    How do you get word count to print at the end of a document in Pages?

    Pages v5 does not provide a user assignable word count variable. With some AppleScript, and a paste operation from the clipboard, you can have locale punctuated word count in this format: 7,803 — anywhere in your document. The following AppleScript works with Pages '09 v4.3 through Pages v5.5.2 on Yosemite.
    I would suggest that you copy paste the following AppleScript into your [Apple] Script Editor and save it (suggestion) wordcnt.applescript. Then, follow this with an option+Save As… and this time set the File format to Script Bundle, or Application with hidden extension — saved to your Desktop. Provided you have a Pages document open, you are then a double-click from the ability to paste your current word count into Pages.
    Note: If you have Pages word count display enabled, it will automatically count your pasted value as another word which initially may deceive on true word count at the time the script was run.
    AppleScript
    --- copy below this line ---
    property locale : "en_US.UTF-8" -- In Terminal, use the locale command to see yours
    if not ApplicationIsRunning("Pages") then
         display dialog "Pages must be running to use this utility."
         return quit
    end if
    tell application "Pages"
        tell body text of front document
            set wordCnt to count words
            -- Don't want punctuated numbers? Remove the single quote from printf format
            set the clipboard to (do shell script "export LC_ALL=" & locale & "; printf \"%'d\" " & wordCnt)
        end tell
    end tell
    on ApplicationIsRunning(appName)
         tell application "System Events" to set appNameIsRunning to exists (processes where name is appName)
         return appNameIsRunning
    end ApplicationIsRunning

  • How can I get Sender Display Name using Get-MessageTrackingLog?

    Hi, could you please help me. We have got a monitoring system at work which monitors some devices, so if something wrong happening with these devices email is sent from MASTER email (Customer Name <[email protected]>) to us. I'm trying to get a list
    of all emails of that monitoring mailbox using PoweShell command
    Get-MessageTrackingLog and export them to CSV file. In the end of the day I need CSV file with 3 columns: TimeStamp, MessageSubject and SenderDisplayName! Yes, I need Sender Display Name cause all emails are sent from one MASTER email
    (Customer Name <[email protected]>) and only difference between them is sender Display Name which is cexactly what I need.   
    This is the code I'm using:
    Get-MessageTrackingLog -EventId Receive | Select Timestamp, MessageSubject, Sender | Export-CSV C:\NagiosAlerts.csv
    –NoTypeInformation
    So how can I get sender Display Name(Customer Name) using Get-MessageTrackingLog insted of Sender email (<[email protected]>)? 

    The DisplayName is not recorded in the Logs only the EmailAddresses are so there Is nothing you can do with Message Tracking to get this the way you want. You need to look at another property may soureIP or include something in the Subject
    of the Email (eg a customerId in the Subject is a much better option) to give you some differentiation. Otherwise you need to access the Email directly from the Mailbox it was sent to and then extract the DisplayName from the message (or use a journaling
    on those emails etc)
    Cheers
    Glen

  • How do I get full display on sony tv w/macbook pro

    how do I get full display on sony tv w/macbook pro? I am using mini dv adapter to pc input cable.(I believe hd15) not HDMI adapter.

    How is the image you get now deficient?
    Are you mirroring or using extended desktop mode?
    What resolution(s) are you using?

  • How can I get a display of all running programs in lion like I used to get when I did a 4 finger swipe in snow leopard?

    how can I get a display of all running programs in lion like I used to get when I did a 4 finger swipe in snow leopard?
    I liked to turn off running programs without a window that I was no longer using
    thanks.
    Best I can do now is to open the "force quit" window and click on programs I want to stop and then send each one a "command-Q" and then repeat as necessary
    Jeff

    Command + Tab is what you are after i think

  • How can I get LION to let me see the side of folders?

    How can I get LION to let me see the side of folders?
    and files? at the bottom of the window as in snow leopard.
    I miss this and rely on it to monitor the available space on the hard drives ect.

    Dov, that is close but not in the status bar but at the bottom of the volder window. Surely , everyone can't have forgotten snow leopard and leopard et al already, where you could could to display at the bottom of all ovened folders to see the status of the the files and hard drive. Boy I WISH I HAD A SCREEN SHOT OF WHAT I AM TALKING ABOUT. 
    Yes you can get the info from get info and in the list view. But we use to be able to have a line at the bottom that gave a running total, which to me was very useful as I throughput mondo files to discrete drives thoughout my network for sorting photos by topic to seperate drives.
    ah here we go a screen shot off my macbook running snow leopard, it is that grey  bar at the bottom which says "4 items 137,26 GB available",that I am wanting in the LION window bottom.

  • I downloaded a WMA audiobook from library using Overdrive. It shows up on my Itunes listing of Audiobooks on my Ipod, but on the actual Ipod it only shows up on Playlists. How do I get it to show up under Audiobooks?

    I downloaded a WMA audiobook from library using Overdrive. It shows up on my Itunes listing of Audiobooks on my Ipod, but on the actual Ipod it only shows up on Playlists.  It is marked as an audiobook in Options | Media Kind.  It is also marked to Remeber Position, but it does not do that. How do I get it to show up under Audiobooks and remember the position?  I have a 4th Gen Ipod running Ios5

    Check out the instructions for a work around on this post: https://discussions.apple.com/message/18702732#18702732
    This worked for me.  I would like to see Apple fix this issue, as it isn't very fun to have to do this for every downloaded book.

  • I have a 120gb Classic that has no space left on it. i am going to buy a larger gb capacity ipod as soon as i get clearer instruction on how to get the old ipod content to the new ipod. How do you get content from one ipod to the other?

    how do you get content from one ipod to the new one? my content is on an external hard drive not on my pc and i have run out of space on my 120gb classic. can you get old ipod content to new? my itunes has only got short cuts, the real content is on an external drive? can this be done?? please help

    If the content is on an external drive, but your library knows where to find it, then it should all work. Connect your device, make some selections for what to put on it, and sync. If, on the other hand, your current iPod is the only place holding some of your media then see this user tip: Recover your iTunes library from your iPod or iOS device.
    tt2

  • How do i get on my apple account on the desktop without signing up with a credit card or Itunes card, i already have an account it just won't let me sign in without giving the desktop version a credit card

    How do i get on my apple account on the desktop without signing up with a credit card or Itunes card, i already have an account it just won't let me sign in without giving the desktop version a credit card

    SEARCH!
    http://lmgtfy.com/?q=itunes+account+without+credit+card

  • When I use Home sharing, I can see the library I want to copy, but when I highlight the library, the import button does not show up. Also, it will not let me drop and drag. How do I get music from one computer to the other computer?

    When I use Home Sharing, I can see the library I want to copy under Shared, but I can't get it save on the computer under the regular library. I go to edit and "select all" but there is no import button that is in the right hand corner. Also, it will not let me click and drag the music. How do I get it from one computer to the other?

    Since both computers are connected via the network, you could simply copy the ENTIRE iTunes folder from one computer to another via the network.
    If both computers are running Windows, use the Easy File Transfer Utility built into Windows to move iTunes and all other user media/data.

  • HOW CAN I GET A DESCRIPTION OF ALL OF THE FRATURES IN lION 10.7.4

    How can I get a description of all of the programs that came with my mac pro without spending an arm and a leg?

    This is a good place to start and follow the links to all the Mac 101 articles.
    http://www.apple.com/support/mac101/
    Regards,
    Captfred

Maybe you are looking for

  • Missing ID3 Tags

    Is there an open-source app or one that supports PPC Macs that helps you fix missing ID3 tag data? ITunes 7 is amazing with the new search engine + cool UI to quickly pick the album of your choice.... HOWEVER, I have no use for this since some dork t

  • Screen Tearing With Radeon HD 6950

    I am having problems watching DVDs. Every DVD I try to watch has a LOT of screen tearing. I have tried mplayer, VLC, xine, and totem with the same results for all of them. Currenty, I am using the catalyst drivers supplied by AMD. Enabling v-sync and

  • Videos in Safari Work Sporadically

    I have been experiencing issues with video playback on my Mac from time to time.  Youtube, and videos in facebook. I am running the lastest OS, and is updated, Mountain Lion.  The only way to get the videos working again is to close Safari, and reope

  • JViewPorts Client not refreshed

    hello, I am sorry for my uncorrect format in the last try to ask...I am afraid. I please for some help in following problem... Starting point: JScrollPane scrollPane = new JScrollPane(); scrollPane.setPreferredSize(new Dimension(500,450));//viewClien

  • Can anybody tell how to compare two documents with two pointers controlled with the same mouse

    can anybody tell how to compare two documents with two pointers controlled with the same mouse ??