こんにちは、jframe に複数のコンポーネントを追加しようとしています。しかし、私はそれを機能させることができないようです。
private void initGUI() {
setAlwaysOnTop(true);
setUndecorated(true);
AWTUtilities.setWindowOpaque(this, false);
AWTUtilities.setWindowOpacity(this, 0.5f);
setLocation(ini.getButtonsX(), ini.getButtonsY());
setSize(ini.getButtonsW(), ini.getButtonsH());
setLayout(null);
JPanel panel = new JPanel();
panel.setLayout(null);
ImageView baron = new ImageView("image/nashor.png", 50, 50);
baron.setBounds(50, 50, 50, 50);
ImageView test = new ImageView("image/dragon.png", 50, 50);
test.setBounds(50, 150, 50, 50);
panel.add(baron);
panel.add(test);
panel.setBounds(0, 0, ini.getButtonsW(), ini.getButtonsH());
add(panel);
}
私の ImageView は、画像を描画する JPanel を拡張するクラスです。
この時点で、nashor のみがペイントされます
どんな助けでも大歓迎です。