So this is going to sound ridiculous but I am working on a project where I deliberately want to slow down the loading of an image down so that it loads line by line. Is there anyway I can do this? I currently have the image in an ImagePane which is just an extension of a JPanel:
public ImagePane() {
initComponents();
image = null;
//this.setAutoscrolls(true);
}
public void setImage(String path) throws IOException {
image = ImageIO.read(getClass().getResource(path));
}
@Override
public void paintComponent(Graphics g)
{
//Graphics2D g2 = (Grahpics2D)g;
g.drawImage(image, 0,0, this);
}
And in my window that I'm trying to display this as:
ImagePane image = new ImagePane();
try {
image.setImage("netscapelogo2.png");
}
catch (IOException e) {
System.out.print("Failed to Set");
e.printStackTrace();
}
//jScrollPane1.add(image);
jScrollPane1.setViewportView(image);
I imagine that i need to someone change my paintComponent method to do this but I'm not sure exactly how to do that.