JOptionPane.showMessageDialog(null, "Blank names not allowed");
解决方案 »
- 关于RandomAccessFile的read(c, 0, 5)方法的疑问,请帮忙!
- 子菜单被按钮遮住了怎么办?急
- JAVA小问题
- 大家有什么好的邮件服务器吗?向给100分,再200分相送
- RE:int[][]有clone()方法吗?
- 一个简单的问题?
- 为什么我的java文件运行时会报错:Exception in thread "main" java.lang.NoClassDefFoundError: java/HelloWorld
- 如何在jb7里调试界面程序
- ----------------jdk1.3编程环境的设置问题----------------
- tomcat 是web server 還是 application server?
- 关于及时刷新的问题,求教
- 关于static的问题,请帮我找找原因。
Examples:
Show an error dialog that displays the message, 'alert':
JOptionPane.showMessageDialog(null, "alert", "alert", JOptionPane.ERROR_MESSAGE); Show an internal information dialog with the message, 'information':
JOptionPane.showInternalMessageDialog(frame, "information","information", JOptionPane.INFORMATION_MESSAGE);Show an information panel with the options yes/no and message 'choose one':
JOptionPane.showConfirmDialog(null,
"choose one", "choose one", JOptionPane.YES_NO_OPTION);Show an internal information dialog with the options yes/no/cancel and message 'please choose one' and title information:
JOptionPane.showInternalConfirmDialog(frame,
"please choose one", "information",
JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE);Show a warning dialog with the options OK, CANCEL, title 'Warning', and message 'Click OK to continue':
Object[] options = { "OK", "CANCEL" };
JOptionPane.showOptionDialog(null, "Click OK to continue", "Warning",
JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE,
null, options, options[0]);Show a dialog asking the user to type in a String:
String inputValue = JOptionPane.showInputDialog("Please input a value"); Show a dialog asking the user to select a String:
Object[] possibleValues = { "First", "Second", "Third" };
Object selectedValue = JOptionPane.showInputDialog(null,
"Choose one", "Input",
JOptionPane.INFORMATION_MESSAGE, null,
possibleValues, possibleValues[0]);应该很有用,你看看吧