can't make the Jlayer change position with the scrollpane

339 views Asked by At

I'm having a jlayer decorationg a panel that is added on a jscrollpane. When i scroll down, the panel components gets scrolled in the right way but i can't make my jlayer move with it. Any ideas on how to do so?

jlayer = new JLayer<JComponent>(scrollPane, ui);
pane.add(jlayer);

thank you in advance

1

There are 1 answers

0
user1436818 On

I found a solution for that by adding the jlayer on a new JScrollPane:

jlayer = new JLayer<JComponent>(scrollPane, ui);
JScrollPane scroll=new JScrollPane(jlayer);
pane.add(scroll);