标签:
确认对话框(0是,1否,2取消):(1)在窗体类中:int result = JOptionPane.showConfirmDialog(this, "hello everyone!");
(2)在类之外:int result = JOptionPane.showConfirmDialog(new JFrame(), "hello everyone!");
或int result = JOptionPane.showConfirmDialog(null, "hello everyone!");(使用默认的Frame作为父窗口,此时对话框在屏幕正中)。
输入对话框:String input = JOptionPane.showInputDialog("hello, what is your name?");
消息显示框:JOptionPane.showMessageDialog(new JFrame(), "Hi everyone, my name is shudaye");
标签:
原文地址:http://www.cnblogs.com/quanxi/p/5959915.html