I have a problem.
I have a JFrame with some JTextFields, JLabels, Jlists & JButtons now the contents of my frame is more than the screen area so I want to attach a JScrollBar to my JFrame but my srollbar does not work. So, can anyone please guide me on how I can scroll my JFrame using the JScrollbar?
I should be something like:
It depends on the layout you are using with your JFrame. If you want to add working scrollbar to your panel you should look at the
JScrollPane
class and theScrollable
interface which must be implemented by scrollable components.The How to use scroll panes chapter in the swing tutorial may also be an interesting reading: http://download.oracle.com/javase/tutorial/uiswing/components/scrollpane.html