This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with split panes  RSS feed

 
Arman Charif
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I have a simple class that splits the window into four parts using JSplitPanes.

The problem: In the constructor I set the location of split pane dividers. Works fine.

But if i call one of the set methods (to update whats on the screen) the values i set in the constructor get reset to default values. Even if I manually resize the split panes, calling the set method resets the values..

Any suggestions? All comments will be appreciated.

Arman



 
Rachel Swailes
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there

I found that I had the same problem when using the setDividerLocation(int). Then I tried setting the DividerLocation with the other method that takes a double. Then I made the frame that holds the splitpane listen for the resize events on the frame and then I call a resize method that basically resets the dividerLocation with the same methods that accepts a double.
It's working without a problem now.

Cheers,
Rachel
[ July 12, 2004: Message edited by: Rachel Swailes ]
 
Arman Charif
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rachel,

Which listener did you use to detect changes in divider location?
Could you paste some sample code?

A.
 
Arman Charif
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was struggling with the split pane divider problem (see my post above) for a good few hours. Now it seems that i found a simple solution. I'm going to post it in case someone else comes accross the same problem.

Any further comments, if any, are welcome..

The final code:

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!