[nbusers:swing]Re: Can't highlight button?

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[nbusers:swing]Re: Can't highlight button?

This is a question about SWING, and not specific for NB.

You write "the icon covers all the button" and that's precisley why you
wont see any change in appearance of the button. To me that means that
the icon covers the button and that its graphics gets drawn on top of
the button obscuring the button's graphics.

It is not clear what you want to achieve with the icon and the button.
Assuming you want the icon to be part of the button, you have to set it
as part o fit, either in the constructor or with setIcon(). Their are a
couple of additional set*Icon() methods to change the icon to give
feedback to the user such as the mouse being over the button or the
button being selected.

I hope this helps to solve your problem

killerblade wrote:
> Hello i've made a JButton inside a JPanel inside a JDialog .. when i select an icon for that button where the icon covers all the button , the button becomes not clickable or highlightable.. although events work when i click it but it does not show that the button has been clicked or when i point the mouse at the button it does not show any highlights around the button unless i expand it where the icon does not cover all the button but like that it  becomes ugly and only the part where the icon does not show gets highlighted