jbutton image

hi all!

i have a jbutton with an icon.

but i'd dont like the text be displayed on the button only the icon.

if i dont settext on the jbutton, how can i catch the event from the button when it is clicked.

like

if (command.equals("button clicked") {

....

}

thanks

[320 byte] By [kurapikatsa] at [2007-10-2 15:48:13]
# 1

1: setActionCommand explicitly

or

2: Only associate each ActionListener with exactly one button (or to only buttons that need the same response), so you don't have to check source.

or

3: Check the references instead of the action command:

if (event.getSource()==theButton)

MLRona at 2007-7-13 15:49:42 > top of Java-index,Java Essentials,New To Java...