1
I’m trying to display an image in an app using Swing Java. I take some frames from a video and display them as an image
private void updateView(){
Image tempCurrent = imageProcessor.toBufferedImage(currentImage);
currentImageView.setIcon(new ImageIcon(tempCurrent));
//JOptionPane.showMessageDialog(null, "um alo");
}
I am not a Java programmer, but I need to maintain this code. The "currentImageView.setIcon" procedure should display an image in the Jpanel, but simply does nothing. The variable currentImaveView is Jlabel video. The funny part is that if I run the "Joptionpane", ah image appears.
Can someone help me?
What is
currentImageView
? Where is this component?– Victor Stafusa
You can post more parts of the code?
– Fabricio
currentImageView is a Jlabel
– Paulo
The print is pointing to an invalid link.
– user28595
It must be because I edited the image, but now it’s normal.
– Paulo
If the image appears when Joptionpane appears, then it may be a matter of calling "repaint()". Try this: Run without making Joptionpane appear, then minimize the Window and maximize it (this will cause a repaint), or resize it (it should cause multiple repaints).
– Douglas