how can I scroll my JFrame using the JScrollbar?
问题 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? 回答1: Put all the components in one panel (instead of in the JFrame) Add this panel to a JScrollPane Add the JScrollPane to your frame. I should be something like: JPanel container = new JPanel();