posted 24 years ago
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!