• Post Reply Bookmark Topic Watch Topic
  • New Topic

How come there is no scroll button and can't scroll here  RSS feed

 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have set up a size of the JPanel heaps bigger than the scrollpane...But there is no scroll button nor can it scroll
 
Campbell Ritchie
Sheriff
Posts: 53779
128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Go through the tutorial about scroll panes. There are various options about scroll buttons, but the buttons are usually only visible when the contents of the scroll pane (I think you call that its view pane) are larger than their container (the scroll pane).
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Go through the tutorial about scroll panes. There are various options about scroll buttons, but the buttons are usually only visible when the contents of the scroll pane (I think you call that its view pane) are larger than their container (the scroll pane).


Hello Campbell,
I don't understand why Scroll panes don't work with JPanels, I see that on JFrames, they do work.
How do I make it work on JPanels?
Thanks
Jack
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jacky Luk wrote:
Campbell Ritchie wrote:Go through the tutorial about scroll panes. There are various options about scroll buttons, but the buttons are usually only visible when the contents of the scroll pane (I think you call that its view pane) are larger than their container (the scroll pane).


Hello Campbell,
I don't understand why Scroll panes don't work with JPanels, I see that on JFrames, they do work.
How do I make it work on JPanels?
Thanks
Jack


Alright, I get this. Set on the JScrollPane's preferred size instead.
That works
 
Campbell Ritchie
Sheriff
Posts: 53779
128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well done, getting it to work.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!