I'm trying to find a way to replace all the contents of a JDialog to simply an image. It's for the about page of a project I'm working on and I want when the user clicks on the About section, an image to popup in the style of a JDialog(and to disappear when focus is lost). Example: http://www.tecmint.com/wp-content/uploads/2012/08/About-Skype.jpg There Skype displays only an image they've created as their "About" page. How can I make an "image dialog" in Java(swing)?
How can I make an "image dialog" in Java(swing)?
Use an undecorated JDialog with a JLabel containing an ImageIcon:
JDialog dialog = new JDialog();
dialog.setUndecorated(true);
JLabel label = new JLabel( new ImageIcon(...) );
dialog.add( label );
dialog.pack();
dialog.setVisible(true);