Mega Code Archive

 
Categories / Java / Swing JFC
 

Information dialog with customized logo

import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JOptionPane; public class InputDialog {   public static void main(String argv[]) {     String input = (String) JOptionPane.showInputDialog(         new JFrame(),         "Please enter your favorite Shakespeare play",         "Title", JOptionPane.INFORMATION_MESSAGE,         new ImageIcon("rntsoftLogo.GIF"), null, "Romeo and Juliet");     System.out.println("User's input: " + input);   } }