resizing an imageIcon of a jLabel on a jLayeredPane

I have 2 questions, somewhat related:

Question 1:

I have a jLayeredPane with a number of jLabels of imageIcons.

I need to resize the top imageIcon when I move a slider. To get the top component on the jLayeredPane, I use:

Component topComponent = layeredPane.getComponent(0);

However, I can't figure out how to get the image IN the jLabel IN the Component to set its size. Any ideas?

Question 2:

Also, it is easy to add items to a jLayeredPane. For example:

layeredPane.add(myLabel);

but how do I delete an item?

[590 byte] By [Kojow777a] at [2007-11-27 11:53:12]
# 1

Q1:

Component topComponent = layeredPane.getComponent(0);

JLabel l=(JLabel)topComponent ;

Q2:

layeredPane.remove(layeredPane.getIndexOf(myLabel));

Regards,

Stas

StanislavLa at 2007-7-29 18:48:57 > top of Java-index,Desktop,Core GUI APIs...