How to add Listener for 'setOneTouchExpandable' of JSplitPane ?

Hi Friends

As I posted this topic under a wrong category, I'm posting it again. I also got one reply, but still I have a problem in adding listener for'OneTouchable' button on divider.

I setsetOneTouchExpandable to true for my JSplitPane by:

splitPane.setOneTouchExpandable(true);

I want to add Listener to that setOneTouchExpandable when user click on that little triangle button of SplitPane's Divider.

I tried this:

BasicSplitPaneDivider divider = ((BasicSplitPaneUI)splitPane.getUI()).getDivider();

divider.addMouseListener(new MouseListener(){

publicvoid mouseClicked(MouseEvent e){}

publicvoid mousePressed(MouseEvent e){}

publicvoid mouseReleased(MouseEvent e){

viewerSize.width = getWidth();

viewerSize.height = getHeight();

fp.setSize(movieScrollPane.getViewport().getWidth(),movieScrollPane.getViewport().getHeight());

fp.validate();

}

publicvoid mouseEntered(MouseEvent e){}

publicvoid mouseExited(MouseEvent e){}

});

But this work only when user drag the divider.It's MouseClick event doesn't work for setOneTouchExpandablebutton which is on splitPan's divider.

So My question is how can I add listener for setOneTouchExpandable when user click on it?

Your any suggestion regarding this topic is valuable for me.

Thanks with hope someone has solution & will reply.

Kirti

[2168 byte] By [Kirti_Mistrya] at [2007-11-27 1:38:06]
# 1
Looks like you could add a PropertyChangeListener for the JSplitPane.DIVIDER_LOCATION_PROPERTY. This will also get fired after a drag, though.
JayDSa at 2007-7-12 0:49:37 > top of Java-index,Desktop,Core GUI APIs...
# 2

In your other posting on this topic your said:

So I want to resize the moviePanel when user click on oneTouchableExpandable button on divider.

Well, I don't understand the problem since the panel will resize automatically when the divider is moved, whether by dragging or clicking on the one touch expandable button.

Since you didn't post a SSCCE, like you where asked to in the other posting then I can't offer any further help.

camickra at 2007-7-12 0:49:37 > top of Java-index,Desktop,Core GUI APIs...
# 3

yes, I want to resize a moviePanel when user click on oneTouchable button on divider or drag the divider .

It work when I drag divider but not for button on divider.

> Since you didn't post a SSCCE, like you where asked to in the other posting then I can't offer any further help.

sorry I didn't understand your above sentence. What do you mean vy SSCCE?

Please, If you have some other way to do it then let me write

Thank you,

Kirti_Mistrya at 2007-7-12 0:49:37 > top of Java-index,Desktop,Core GUI APIs...
# 4
> What do you mean vy SSCCE?[url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program[/url]
JayDSa at 2007-7-12 0:49:37 > top of Java-index,Desktop,Core GUI APIs...
# 5
Hey you are right. There is no need to write listener. I solved my problem by adding splitPane.addPropertyChangeListener to DIVIDER_LOCATION_PROPERTYThank you very much. I really appreciate your helpThank you
Kirti_Mistrya at 2007-7-12 0:49:37 > top of Java-index,Desktop,Core GUI APIs...