I want to have my own image in my applet to act as Button. So, I'll have different images -- for Enabled button status, Disabled, with Mouse Over It, when it is Pressed, etc. But how to create it as a button? The only thing I found is to have regular Button (JButton) _inside_ of which we can have an image. But nothing more...
JButton has setDiabledIcon(), setDisabledSelectedIcon(), setIcon(), setPressedIcon(), setRolloverIcon(), setRolloverSelectedIcon(), and setSelectedIcon() - all inherited from javax.swing.AbstractButton.
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Originally posted by Panda Mima: I want to have my own image in my applet to act as Button. So, I'll have different images -- for Enabled button status, Disabled, with Mouse Over It, when it is Pressed, etc. But how to create it as a button? The only thing I found is to have regular Button (JButton) _inside_ of which we can have an image. But nothing more...
In addition to the methods Mr. Pruett mentioned, there are also setBorderPainted(), setContentAreaFilled(), and setFocusPainted().
Set these to false if you want the button to appear as an unadorned image.