• Post Reply Bookmark Topic Watch Topic
  • New Topic

what's possible reason for this?

 
rose deng
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi.
I add a scrollbar to a panel,but scrollbar knob dissapear,and arrow is grey.
How to solve this ?
Thank you.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got some code to show us???
 
Chris Shepherd
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like you have not set the scrollbar max above zero, or else it might that the scrollbar is not enabled. Try
scrollBar.setEnabled(true);
If you are using a JScrollPane instead of a JScrollBar, It may be that you have set the scrollbars to always display, and whatever you have inside the scrollpane is not big enough to need a scrollbar. You can set the scrollbar settings for a JScrollPane by using
setHorizontalScrollBarPolicy(int policy)
where policy is one of:
JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED
JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER
same thing for the verticalScrollBar
Good Luck!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!