私は 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);
}
}
繰り返しますが、助けてくれてありがとう。