• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Spilt pane query

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The JSplitPane contains setDividerSize and setDividerLocation methods which you can help you achieve the desired result.
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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);
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic