0

Hello,

I'm having a requirement to develop a GUI based JFrame which should have capabilities to add Multiple JPanel on an event occurrence[Ex. button click] and the JFrame should be scrollable.

I tried a lot, but I failed. I also tried to add multiple Jpanel in JScrollpane that also failed. Can somebody help me please?

Thanks in advance,

regards,

Gokul Rangarajan

2
Contributors
2
Replies
6
Views
7 Years
Discussion Span
Last Post by gokul.raja
0

Add a single JPanel to the JScrollPane. Use FlowLayout with vertical (or horizontal, depending on which way you want to "scroll") alignment in that JPanel, and add the JPanels that are to be added "dynamically" to that JPanel. Then, don't forget to call validate() and/or repaint() on the JScrollPane.

Edited by masijade: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.