Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
フォトショップで作成した画像をGUIの背景として使用しようとしています。それ、どうやったら出来るの?また、アクションの実行後にボタンの背景に表示したい画像をいくつか作成しました...
JButtonの場合、これを使用します。
JButton button = new JButton("Button Name", new ImageIcon("foo.png");
パネルはもう少し面白いです。ただし、これは良い方法です。
ImagePanel panel = new ImagePanel(new ImageIcon("foo.png").getImage());