posted 19 years ago
Hi ,
im trying to use a gridbag constraing layout.
I want to add 2 Jpannels and 2 Jbuttons. But the panels do not appear on the screen just the buttons. All other layout managers add my panels fine.
any ideas?
JInternalFrame fr1 =
new JInternalFrame("app", true, true);
fr1.setBounds(0, 05, 900, 900);
Container cn = fr1.getContentPane();
cn.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.gridx=0;
c.gridy=0;
cn.add(a,c); //button
c.gridx=0;
c.gridy=1;
cn.add(b,c); //button
c.gridx=0;
c.gridy=2;
cn.add(ca,c); //button
c.gridx=0;
c.gridy=3;
cn.add(a,c); //button
c.gridx=1;
c.gridy=1;
cn.add(panelb,c); //panel
c.gridx=1;
c.gridy=2;
cn.add(panela,c); //panel