O
oliviergir
Hi,
I am displaying a big image within a smaller JcrollPane component like
this :
panel = new MyJPanel(this,image);
jScrollPane=new JScrollPane(panel);
getContentPane().add(BorderLayout.CENTER, jScrollPane);
And within the constructor of MyJPanel (class that extends JPanel) :
this.image=image;
imageIcon=new ImageIcon(captureImage);
jLabel=new JLabel(imageIcon);
add(jLabel);
The image appears with the scrollbars and that's fine.
Now there is button (in the north) and when it is clicked I want to
update the jscrollPane with a new image but that is not working.
I tried changing the image and repainting but it does not work..
I tried removing the jscrollPane component, creating a new one and
adding it to the contentPane and repainting but the display does not
refresh..
Any idea ??
I am displaying a big image within a smaller JcrollPane component like
this :
panel = new MyJPanel(this,image);
jScrollPane=new JScrollPane(panel);
getContentPane().add(BorderLayout.CENTER, jScrollPane);
And within the constructor of MyJPanel (class that extends JPanel) :
this.image=image;
imageIcon=new ImageIcon(captureImage);
jLabel=new JLabel(imageIcon);
add(jLabel);
The image appears with the scrollbars and that's fine.
Now there is button (in the north) and when it is clicked I want to
update the jscrollPane with a new image but that is not working.
I tried changing the image and repainting but it does not work..
I tried removing the jscrollPane component, creating a new one and
adding it to the contentPane and repainting but the display does not
refresh..
Any idea ??