I have a JLayered pane that has a large sized JLable that is showing an image that is used to show a background image. This is on the default layer.

Inside I have many items such as lables, textfields, tables and other such things. These are set for the pallet layer and allow these items to show up over the background image. Looks good and works great...

What I would like to do in the program, is on a particular point in processing, to change a list and a accompaning JLable's property value (Pallet layer) from default to pallet and back again.

Essentially this would make the list & lable essentially appear and dissapear...
ie something like JLable_Name.propertyChange.Layer.Pallet_Layer

I know that was not Java code, but is such an animal possible?

Thanks for any thoughts on this.....

Recommended Answers

All 3 Replies

I am seeing this in netbeans:

Scroll_Type.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Mage", "Priest" }));
Scroll_Type.setBounds(610, 70, 60, 30);
jLayeredPane1.add(Scroll_Type, javax.swing.JLayeredPane.PALETTE_LAYER);

Should I use this to change the properties in my code?
I can easily just add a pop-up to get the info when necessary, which ever is easier.

If you just want JComponents to disappear/reappear why not just setVisible(true/false)?

Thank you james.....

That is what I was looking for, just didn't know how to do it..... :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.