• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Problem with split panes

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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



 
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:

reply
    Bookmark Topic Watch Topic
  • New Topic