Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1
put the related components as a group in JPanel, then arrange those panels in a single window. if this got way too much which is bad for ux, use JDesktopPane but if using "virtual" desktop isnt suit you, last option i could think is to use JTabbedPane i always use grouplayout i know its not the most readable one, but it just stick to me.
25th Nov 2019, 2:01 AM
Taste
Taste - avatar
+ 1
they're equally interesting tbh. gridbag has a big plus in readability and much more easier to comprehend. group layout in the other hand really easy to get messy and a bit harder to understand, which is normal since it is made to be automaticly generated not hand written. but has much more control over smaller things from my perspective.
25th Nov 2019, 6:09 AM
Taste
Taste - avatar
+ 1
oooh so you sepearte each panel as its own class ? i think simple setter and getter should be good for comunicating between class
25th Nov 2019, 6:12 AM
Taste
Taste - avatar
+ 1
i rarely subclassing any swing container, simply because there are no behavior change or addition that i need. i think setter getter is the best way other possible way, by using abstract function to pass other panel: https://code.sololearn.com/cILU0qF33U6m/?ref=app it may not the best solution though
25th Nov 2019, 7:55 AM
Taste
Taste - avatar