Article View: borland.public.jbuilder.java.swing
Article #7564Re: JTree in JScrollPane
From: Torsten Welches
Date: Fri, 19 Jan 2001 06:46
Date: Fri, 19 Jan 2001 06:46
53 lines
2343 bytes
2343 bytes
Thomas, your snippet looks good except that it must read "new JTree();" But I guess that's just a typo in your post - it wouldn't compile that way. ScrollOnExpand is true by default, so you don't need to set it. It doesn't hurt, however. I can't comment on the Designer issue since I don't use it, but I assume your problems originate outside your snippet. Do you see the scollpane at all? Did you by chance add the table rather than the scrollpane to your parent panel/frame? Torsten "Thomas G�lden \(p\)" <Thomas.Guelden@t-online.de> wrote: >I have problems realizing that when opening a node in a tree, which is >placed in a JScrollPane, the scrollpane scrolls so that all child nodes are >visible. > >I use basically the following code: > >JTree tree = new JTree; >.... >JScrollPane pane; > > >in JbInit(): > >pane = new JScrollPane(tree); >.... >tree.setScrollOnExpand(true); >.... > >This code does not lead to automatic scrolling when a node is expanded and >the child are out of view (ath the bottom). > >Strangely also that in the Designer component tree in the JBuilder IDE, tree >is no a child of pane. > >So I do not know what is wrong with my code. I would be glad if somebody >could provide some working sample code for this particular problem. > >Thanks in advance and kind regards. > >Thomas G�lden > >Thomas.Guelden@t-online.de > > > >
Technical Details
Message-ID:
<3a67e2c6$1_1@dnews>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.uni2.dk!newssuck.uni2.dk!bornews.borland.com!dnews!207.105.83.65References:
<947t22$55b7@bornews.inprise.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 111d45,d328df32c92f513a X-Google-Attributes: gid111d45,public X-Google-ArrivalTime: 2001-01-18 22:51:43 PST From: "Torsten Welches" <torsten.welches@who.cares.netcologne.de> Sender: "Torsten Welches" <torsten.welches@who.cares.netcologne.de> Reply-To: "Torsten Welches" <torsten.welches@who.cares.netcologne.de> Subject: Re: JTree in JScrollPane Newsgroups: borland.public.jbuilder.java.swing X-User-Info: 193.158.55.74 193.158.55.74 References: <947t22$55b7@bornews.inprise.com> NNTP-Posting-Host: 207.105.83.65 Message-ID: <3a67e2c6$1_1@dnews> Date: 18 Jan 2001 22:46:30 -0800 X-Trace: 18 Jan 2001 22:46:30 -0800, 207.105.83.65 Lines: 54 Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.uni2.dk!newssuck.uni2.dk!bornews.borland.com!dnews!207.105.83.65