i'm doing a gallery with some images (jpanels) into a other jpanel on a jScrollPane but on the scroll is too slow. i have a problem with the repaint of the jpane photos?
@Override protected void paintComponent(Graphics g){
super.paintComponent(g);
if(!full){
height=this.getWidth()*img.getHeight(this)/img.getWidth(this);
g.drawImage(img, 0, 0,this.getWidth(),height,null);
}
else{
width=this.getHeight()*img.getWidth(this)/img.getHeight(this);
g.drawImage(img,this.getWidth()/2-width/2, 0,width,this.getHeight(),null);
}
g.dispose();
img.flush();
}