-2

I want to create a button that has 2 (or more) images inside (left and right of button). I researched but have not idea. Can you help me?

Opal
  • 76,740
  • 25
  • 177
  • 200
Phạm Quốc Bảo
  • 794
  • 2
  • 9
  • 19

2 Answers2

0

use this code for every button

JButton left_btn = new JButton(new ImageIcon("image_address"));
JButton right_btn = new JButton(new ImageIcon("image_address"));
Avanish Kumar
  • 2,208
  • 3
  • 25
  • 33
0

You can use the Compound Icon. It is a custom Icon that allows you to combine two icons into one. So you can combine two ImageIcons into one. Then you add the CompoundIcon to the button.

camickr
  • 316,400
  • 19
  • 155
  • 279