I’m very new to Swing and I need to build a JFrame
that:
- Has an image on top.
- Below the image has 16 little images divided into 4 groups (4 “panels”), on the same “row”.
- Below those 16 images I need 4 “panels” on the same “row”. Every panel contains some horizontal scrollable images (of the same size).
- Below those 4 “panels” I need two “panels” on the same “row”. The left one contains some horizontal scrollable images (of the same size), the right one a
JList
(or something like that: scrollable text rows). - Below those 2 “panels” i need 4 “panels” on the same “row”. Every one contains 4 rows of text.
How can I create a JFrame
like this? I tried using only BorderLayout
s and GridLayout
s but I don’t know how to divide the GridLayouts
in other GridLayouts
(Don’t even know if it’s possible).
Advertisement
Answer
Create one panel and add it to frame, set layout(GridLayout(6,1))
. Then you can create classes or methods and extend it to JPanel and create each panel. And after try to add all this panels to you main panel in The frame.
I don’t know if I understood correctly what you want, this is solution I found.