From d828af0288c1fa98831af668458925b14121be49 Mon Sep 17 00:00:00 2001 From: pf4fw5i2c <2842864518@qq.com> Date: Sat, 13 Apr 2024 19:21:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Test.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/Test.java diff --git a/src/Test.java b/src/Test.java new file mode 100644 index 0000000..6185187 --- /dev/null +++ b/src/Test.java @@ -0,0 +1,20 @@ +import javax.swing.*; + +public class Test { + public static void main(String[] args) { + Object[] objects={"人人对战","人机对战"}; + int a = JOptionPane.showOptionDialog(null,"请选择游戏模式","请选择",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,null, objects, objects[0]); + System.out.println(a); + if (a == 0){ + MyJFrame mj = new MyJFrame(); + mj.myJFrame(); + }else if (a == 1){ + MyJFrame_AI mjAI = new MyJFrame_AI(); + mjAI.myJFrame(); + }else{ + System.exit(0); + } + } +} + +