Sagewire Logo

Capturing event generated by JSplitPane

2 Message(s) by 2 Author(s) originally posted in java gui


From: Chanchal Date:   Wednesday, September 19, 2007
Hi All,
I have a JFrame on which 4 JSplitPanes are nested. Each JSplitPane
other than the last one contains a JPanel and a nested JSplitPane. The
last one contains two JPanels. I need to capture the event when the
divider of JSplitPane is moved so that make some modification in the
contianed JPanel. Please advise on how this can be achieved.

Thanks in advance

Chanchal


From: Steve W. Jackson Date:   Wednesday, September 19, 2007
In article <1190212627.827305.144140@xxxxxxxxxxx>,
wrote in message:

Hi All, I have a JFrame on which 4 JSplitPanes are nested. Each JSplitPane
other than the last one contains a JPanel and a nested JSplitPane. The
last one contains two JPanels. I need to capture the event when the
divider of JSplitPane is moved so that make some modification in the
contianed JPanel. Please advise on how this can be achieved.
Thanks in advance
Chanchal



Proper use of layout management should make it unnecessary for you to
care when a user moves a divider.

You might be able to add a ComponentListener on your panels to detect
when they are resized. The obvious trouble with that, however, is that
moving the divider on any pane will probably cause some or all of the
others to get resized, thereby firing their own listeners.

You could also add a PropertyChangeListener to each split pane to detect
changes in the JSplitPane.DIVIDER_LOCATION_PROPERTY.
--
Steve W. Jackson
Montgomery, Alabama



Next Message: Setting component size while using border layout



Programming | Sports | Autos

copyright 2006
Valid XHTML 1.0 Transitional