Article View: borland.public.jbuilder.java.swing
Article #7569Re: JTree in JScrollPane
From: Thomas G�lden
Date: Fri, 19 Jan 2001 13:17
Date: Fri, 19 Jan 2001 13:17
81 lines
3393 bytes
3393 bytes
Hi Torsten, You were correct about the typo. With "Designer" I mean the visual form editor in JBuilder. The fact that with the code used the tree is not a child of the scrollpane in the design structure view, is probably a problem of JBuilder's code parser and how it maps the statements of jbinit() into a tree structure. This should not affect the behaviour at runtime. The tree *is* apparently in the viewport of the scrollpane , becuase scrolling with the vertical scrollbar works. Just the automatic scrolling if a tree node is expanded and the child go beyond the bottom of the tree, does not work. Still no ideas, what's wrong here. Thomas G�lden Thomas.Guelden@t-online.de "Torsten Welches" <torsten.welches@who.cares.netcologne.de> schrieb im Newsbeitrag news:3a67e2c6$1_1@dnews... > > 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:
<949ej7$ich$1@isp-m-srv06.izb.net>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!sn-xit-04!supernews.com!xfer13.netnews.com!netnews.com!cpk-news-hub1.bbnplanet.com!news.gtei.net!news-FFM2.ecrc.net!news.izb.net!not-for-mailReferences:
<947t22$55b7@bornews.inprise.com> <3a67e2c6$1_1@dnews>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-19 05:22:18 PST Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!sn-xit-04!supernews.com!xfer13.netnews.com!netnews.com!cpk-news-hub1.bbnplanet.com!news.gtei.net!news-FFM2.ecrc.net!news.izb.net!not-for-mail From: "Thomas G�lden" <Thomas.Guelden@gla.bayern.de> Newsgroups: borland.public.jbuilder.java.swing Subject: Re: JTree in JScrollPane Date: Fri, 19 Jan 2001 14:17:16 +0100 Organization: IZB - Internet News Service Lines: 83 Message-ID: <949ej7$ich$1@isp-m-srv06.izb.net> References: <947t22$55b7@bornews.inprise.com> <3a67e2c6$1_1@dnews> NNTP-Posting-Host: 212.34.74.75 X-Trace: isp-m-srv06.izb.net 979910055 18833 212.34.74.75 (19 Jan 2001 13:14:15 GMT) X-Complaints-To: abuse@izb.net NNTP-Posting-Date: 19 Jan 2001 13:14:15 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400