demooptionpanel.java

来自「java绘图 java awt 经典绘图的例子,对于初学awt模块的人非常有帮助」· Java 代码 · 共 28 行

JAVA
28
字号
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package swing;import javax.swing.JOptionPane;/** * * @author zhaolin */public class DemoOptionPanel{        public static void main(String[] args) {            String value1 = JOptionPane.showInputDialog(null, "输入第一个数:");            int iValue1 = Integer.parseInt(value1);            String value2 = JOptionPane.showInputDialog(null, "输入第二个数:");            int iValue2 = Integer.parseInt(value2);                        int result = iValue1+iValue2;            JOptionPane.showMessageDialog(null, result);                                }    }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?