-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
  • 81,889
  • 28
  • 189
  • 210
Phạm Quốc Bảo
  • 864
  • 2
  • 10
  • 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"));
A.K.
  • 2,284
  • 3
  • 26
  • 35
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
  • 321,443
  • 19
  • 166
  • 288