import java.util.Scanner;
import javax.swing.JOptionPane;
public class calculator {
public static void main(String[] args)
{
int num1;
int num2;
String operation;
Scanner input = new Scanner(System.in);
System.out.println("please enter the first number");
num1 = input.nextInt();
System.out.println("please enter the second number");
num2 = input.nextInt();
System.out.println("Please enter operation");
operation = input.next();
if (operation.equals ("+"))
{
JOptionPane.showMessageDialog(null,"your answer is" + " " + (num1 + num2));
}
if (operation.equals ("-"))
{
JOptionPane.showMessageDialog(null, "your answer is " + " " + (num1 - num2));
}
if (operation.equals ("/"))
{
JOptionPane.showMessageDialog(null,"your answer is" + " " + " " + (num1/num2));
}
if (operation.equals ("*"))
{
JOptionPane.showMessageDialog(null,"your answer is" + " " + " " + (num1 * num2));
}
}
}
嗨,爲什麼JOption對話框顯示在應用程序的後臺?我是編程新手,我仍然無法解決這個錯誤。JOption對話框在後臺顯示
你的意思是 「在後臺」? –