我已经着手设置我的 JFrame 的背景图像,但现在我的组件(我假设)卡在它后面。我已经尝试阅读有关顶级容器的信息,但我无法理解它T_T。有人有想法么 ?也许我需要找到另一种设置背景图像的方法?感谢您的任何帮助。:
@SuppressWarnings("serial")
public class CopyOfMainMenu extends JFrame {
//Running the GUI
public static void main(String[] args) throws IOException {
CopyOfMainMenu gui2 = new CopyOfMainMenu();
gui2.mainPanel();
}
public void thepanel () throws IOException {
// GridBagLayout/Constraint
GridBagConstraints gridbagc = new GridBagConstraints();
gbc.insets = new Insets(15, 15, 15, 15);
JFrame frame = new JFrame();
JPanel panel = new JPanel(new GridBagLayout());
// Creating JButtons/Icons
panel.add(buttonTwo, gbc); //SCOREBOARD
panel.add(buttonThree, gbc); //INSTRUCTIONS
// JButton size's
button.setPreferredSize(new Dimension(400, 35))
buttonTwo.setContentAreaFilled(false);
buttonThree.setBorder(BorderFactory.createEmptyBorder());
buttonThree.setContentAreaFilled(false);
}
}
再次,提前感谢您的帮助。