I wish to add 3 JPanels, all spaced different distances apart, that fill the Content Pane/JFrame. Currently, add(new JPanel()) will overrite the current content pane or not show up at all.
理想的情况是,我希望该守则能够类似(例如,为了:
JPanel panel1 = new JPanel();
panel1.add(new jbutton())
panel1.setBounds(0,0,100,100);
JPanel panel2 = new JPanel();
panel2.add(new jbutton());
panel2.setBounds(100,0,100,100);
getContentPane().add(panel1);
getContentPane().add(panel2);
......
I know a panel can be added to a panel because I ve done it with borderlayout. Please don t tell me to use a layout manager, I ve been using gridbag and it hasn t produced the results I want.
我要完全控制我的物体大小和位置。 另外,请不要告诉我,“你 re;这是 st;为什么你想要这样做?”
仅提供有益的答复。 我不是一位神学家,而只是一个与全球倡议的灰色挫折,因此,我感到可以像你一样深入深入地看待。