Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Spilt pane query  RSS feed

 
Puneet N Vyas
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is the code i have written for creating gui ,where p1 and p2 are panels,i have added two text area one in the upper panel and another at the bottom panel,now i want that half the window space should be occupied by the panel containing upper text area and bottom half should be occupied by the lower text area,i.e half the frame occupied with text area(upper) and half with bottom text area(lower).. ,and after i have given equal space to upper and lower components in JPanels ,i want that resizeing should be disabled..

{JSplitPane sp = new JSplitPane(JSplitPane.VERTICAL_SPLIT,p1,p2);
c1.add(sp,BorderLayout.CENTER);}

thanks for support...
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JSplitPane contains setDividerSize and setDividerLocation methods which you can help you achieve the desired result.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
splitPane.setResizeWeight(.5);

> i want that resizeing should be disabled..

if you mean you don't want the divider moveable
splitPane.setEnabled(false);
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!