Question about layout in java.
- by extro
I have two panels main_panel and child_panel. I have set layout for main_panel by using
"main_panel.setLayout(flowlayout)" and added child_panel in main_panel by using
"main_panel.add(child_panel)". This child_panel gets added to main_panel but its position is at the cross-section of horizontal midpoint and top vertical section of screen. But I want child_panel to be at the top left corner, something I could have done by using "child_panel.setlocation(a,b)" method, if I have set the Layout of main_panel as NULL.
I have used flowlayout here because I want components in the JPanel to keep
adjusting with the size of JFrame.
So question is, can I add child_panel to main_panel at the exact location I want, even if I set the Layout of main_panel as not NULL.