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.
私はボードゲームを作っていて、ボード上に 3 x 10 のボタンがあります。ボタンに画像アイコンを追加して、ボードのピースを表すにはどうすればよいですか?
最初の 10 個のボタンにのみ必要です。
BufferedImage im = ImageIO.read(yourFile); ImageIcon ii = new ImageIcon(im); JButton b = ...; b.setIcon(ii);