• Post Reply Bookmark Topic Watch Topic
  • New Topic

jScrollPane is disabled  RSS feed

 
micheal bevan
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why jscrollPane is disabled when I set the layout of child jpanel to null ?
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Michael, and welcome to the Ranch!

How do you know it's disabled? Does getEnabled() return false?
 
Rob Camick
Ranch Hand
Posts: 2756
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why jscrollPane is disabled when I set the layout of child jpanel to null ?


Scrollbars appear automatically when the preferred size of the component added to the scrollpane is greater than the size of the scrollpane.

When you set the layout to null the component has a preferred size of 0, so there is no reason to show the scrollbars.

Do Not, set the layout to null. Swing was designed to be used with a layout manager so all components will work as expected.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!