Image component « GlassPane « Java Swing Q&A





1. image in glassPane    coderanch.com

Post code! This works for me. Notice that you may have to explicitly reset your glasspane to be visible after you add it. import java.awt.*; import java.awt.image.*; import java.io.*; import java.net.URL; import javax.imageio.*; import javax.swing.*; public class Test { public static void main(String[] args) throws IOException { URL url = new URL("http://today.java.net/jag/bio/JagHeadshot.jpg"); BufferedImage image = ImageIO.read(url); BufferedImage copy = new BufferedImage(image.getWidth(), ...