How to create a selectable Panel (for Synth Look and Feel)

H

hogcia

Hello,

I've encountered a problem with Synth Look and Feel and component
states. I have a component extending a jPanel, and I use it as tabs
for other panels. Here is a screenshot:

http://img172.imageshack.us/my.php?image=zakladkatytul.png

The components I am talking about are "JK Test" and "WydrukPanel"
tabs. In Synth I am able to paint them with a picture, but I can't
change the picture (and the tab's color) when a tab is selected - as
you can see they are both green. This is because Panels only have an
ENABLED and DISABLED states (according to Synth documentation).

So to put it short - I would like to create a component extending a
jPanel, which would also have a SELECTED state that the Synth would
recognize.

Thanks for all your help!
 
H

hogcia

A borderless JButton may be what you need. You get to choose the normal,
rollover, pressed and selected icons (images).

Matt Humphreyhttp://www.iviz.com/

Yes, it would be a good idea, but I also need to have a close button
(the "x" icon) on the Panel and a busy icon, when the program is
loading data.
 
H

hogcia

I'm not sure what the issue is. You can change the icon dynamically any
time you like or in response to external events--just make sure to do it on
the EDT. Are you saying you need the panel itself to have buttons? You can
have multiple buttons that are ordered so some are on top of others. Can
you explain more of what you're trying to do?

Matt Humphreyhttp://www.iviz.com/

The trick is, I want the Synth to change the icon - to do it, Synth
must recognize that the Component's state has changed (i.e. to
SELECTED). This is possible with Buttons, but not with default Panels
(Panels just have a DISABLED and ENABLED states). That is why I want
my Panel to also have a SELECTED state.
I know a Panel can have buttons, and my Panel contains a button and
two labels.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top