重要:JOptionPane类提示框的一些常用的方法
来源:互联网 发布:网络部面试问题有哪些 编辑:程序博客网 时间:2024/06/05 00:43
一般都是都在页面做弹出框,如果后台要做弹出框就可以用JOptionPane类,其中封装了很多的方法。
import javax.swing.JOptionPane;
showMessageDialog
JOptionPane.showMessageDialog(null, "SUCCESS!");
JOptionPane.showMessageDialog(null, "SUCCESS", "TITLE",JOptionPane.PLAIN_MESSAGE);
JOptionPane.showMessageDialog(null, "SUCCESS", "TITLE",JOptionPane.WARNING_MESSAGE);
JOptionPane.showMessageDialog(null, "ERROR" , "TITLE",JOptionPane.ERROR_MESSAGE);
showOptionDialog
int n = JOptionPane.showConfirmDialog(null, "DOWN OR NOT", "TITLE",JOptionPane.YES_NO_OPTION);//Y 0 N 1
Object[] options ={ "OH YES!", "NONO!" };
int m = JOptionPane.showOptionDialog(null, "DOWN OR NOT", "TITLE",JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]);
showInoutDialog
Object[] obj2 ={ "RED", "YELLOW", "GREEN" };
Object[] obj2 ={ "RED", "YELLOW", "GREEN" };
String s = (String) JOptionPane.showInputDialog(null,"WHAT COLOR DO U LIKE?", "COLOR", JOptionPane.PLAIN_MESSAGE, new ImageIcon("icon.png"), obj2, "RED");
0 0
- 重要:JOptionPane类提示框的一些常用的方法
- JOptionPane 提示框的一些常用方法
- JOptionPane提示框的一些常用方法
- JOptionPane类提示框的一些常用的方法
- JOptionPane类提示框的一些常用的方法
- JOptionPane类提示框的一些常用的方法
- JOptionPane类提示框的一些常用的方法
- JOptionPane类提示框的一些常用的方法
- JOptionPane类提示框的一些常用的方法
- JOptionPane类提示框的一些常用的方法
- JOptionPane类提示框的一些常用的方法
- JOptionPane类提示框的一些常用的方法
- JOptionPane类提示框的一些常用的方法
- JOptionPane类提示框的一些常用的方法
- JOptionPane类提示框的一些常用的方法
- JOptionPane类提示框的一些常用的方法
- (转)JOptionPane类提示框的一些常用的方法
- JOptionPane类提示框的一些常用的方法
- Android系统Gps开发
- 日语语法总结-7 md version
- Pro Android学习笔记(一六一):联系人API(4):读取整合联系人
- day7代码积累-java+信管1131班1132班班级抽奖箱
- [Leetcode]3Longest Substring Without Repeating Characters
- 重要:JOptionPane类提示框的一些常用的方法
- 分支-05. 用天平找小球
- You have ettempted to queue to many files.You may select one files.
- 直接选择排序
- Python多线程编程简介
- void 指针的转换
- Xcode的调试技巧
- 三维数组的初始化
- django 框架请求相应流程