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

Size of JScrollPane in a JPanel  RSS feed

 
Kay Tracid
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
is it possible to have a jscrollpane with the same size of a panel in a frame? my scrollpane has a fixed size, but i want it to be as big as possible in my frame. how can i do that? i use gridbaglayout:
gbConstraints.fill = GridBagConstraints.BOTH;
gbConstraints.weightx = 1.0 ;
gbConstraints.weighty = 1.0 ;
gbConstraints.gridx = 0;
gbConstraints.gridy = 0;
gbLayout.setConstraints(myPanelWithScrollPaneInside, gbConstraints);
Thanks a lot!
 
Don Kiddick
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
gbConstraints.fill = GridBagConstraints.BOTH
 
Kay Tracid
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i use this, but my panel is not as width as my frame
 
Don Kiddick
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It will be as wide as the grid "cell" it occupies.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!