🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #12783

JTree in a JScrollPane - problem with autoscrolling behavior

#12783
From: Andrea C. Piccolo
Date: Mon, 16 Nov 1998 00:00
41 lines
2105 bytes
Hey Folks,

(Note : I am using, JBuilder 2.0 and Swing 1.0.3)

I have noticed the following weird behavior with a JTree contained in a
JScrollPane:

----------------------------------------------------------------------------------------

Behavior #1 :
When I expand the tree to expose a node which has a label that extends
past the edge of the scroll pane, the scroll bars appear (which is
expected and OK) and the Tree moves over. As a result, the left-most "+"
handles are moved off the screen.

It almost seems like the scrollRectToVisible method is being called.

How can I prevent the JTree (or Viewport - whichever it may be) from
moving?
---------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------

Behavior #2
When I select one of the labels that extends beyond the scoll
pane, the area that contains the tree resizes to show the entire label.
However, the scroll bar does not grow to span the new width of the
scroll pane.

I have the scroll pane in a split panel. When this resizing occurs, the
split bar is hidden - you can only grab it at the far right of the
scroll bar.

If I minimize the window at this point and open it back up again, the
scroll pane is set back to its original size.

How can I prevent the auto sizing?
---------------------------------------------------------------------------------------

Thank you,
Andrea C. Piccolo
Technical Details
Message-ID: <36505E15.E129096@ccgatewy.gdesystems.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,5a1a941b90607bc4,start
X-Google-Attributes: gid111d45,public
From: "Andrea C. Piccolo" <Andrea.Piccolo@ccgatewy.gdesystems.com>
Subject: JTree in a JScrollPane - problem with autoscrolling behavior
Date: 1998/11/16
Message-ID: <36505E15.E129096@ccgatewy.gdesystems.com>
X-Deja-AN: 412449158
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=us-ascii
Organization: GDE Systems, Inc.
Mime-Version: 1.0
Reply-To: Andrea.Piccolo@ccgatewy.gdesystems.com
Newsgroups: borland.public.jbuilder.java.swing