JPanels in JPanel
I have a problem with Java JPanels. I would like to put 2 JPanels with
different layouts into one JPanel which is also has a layout. Is it even
possible to make it work?
BibP()
setLayout(new GridLayout(5, 1)); //The big JPanel
add(new A(), new FlowLayout(4));
add(new B(), new GridLayout(7,2));
Both A and B are classes extends as JPanels and no matter what I changed
or commented B is always appears in 1 row. I have 4 elements added to A
and 14 to B (JLabels and JTextAreas) and there is not much code in them
only the adds and some calculation.
The problem might be in the JFrame where I am trying to put the big JPanel.
JFrame.this.add(new BigP(),BorderLayout.CENTER);
Thanks for helping.
No comments:
Post a Comment