Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to add scrollbar  RSS feed

 
shriramgaurav chhabra
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello sir

i am making a project in swing .... i have different labels and text fields in it ....

in the last of the form when the page get full then the remaining labels and text fields going down to the page ,,,,,,, and i am not able to see then ... can you please tell me that how to add scrollbar to that ....so that i am i will be able to see the all contents on that particular page ...

how to add scrollbar on that page ...

please help me its urgent...

Sincere Regards

Gaurav Chhabra
 
Stuart Gray
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't actually add a scrollbar to your page - you add your page to a scrollpane. Presumably your components are being added to a JPanel. Then you just need to create a JScrollPane, add your JPanel to it, and then add your JScrollPane to your frame (or whatever).

Hope this helps.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!