About 229,000 results
Open links in new tab
  1. Message Dialogs in Java (GUI) - GeeksforGeeks

    Oct 26, 2021 · Message dialogs are created with the JOptionPane.showMessageDialog() method. We call the static showMessageDialog() method of the JOptionPane class to create a message dialog. We provide the dialog’s parent, message text, title, and message type.

  2. java - JOptionPane showMessageDialog usage - Stack Overflow

    it's a very simple you can use the JOPtionPane method showMessageDialog. and here's a sample code. int num1 = Integer.parseInt(JOptionPane.showInputDialog("Write 1st number.")); int num2 = Integer.parseInt(JOptionPane.showInputDialog("Write 2nd number.")); int sum = num1 + num2; JOptionPane.showMessageDialog(null, "sum = " + sum); After update.

  3. Write a program that creates a user interface to perform integer ...

    Jan 26, 2018 · Write a program that creates a user interface to perform integer divisions. The user enters two numbers in the textfields, Num1 and Num2. The division of Num1 and Num2 is displayed in the Result field when the Divide button is clicked. If Num1 or Num2 were not an integer, the program would throw a NumberFormatException.

  4. 4. Write a Java program that creates a user interface to perform integer divisions. The user enters two numbers in the text fields, Num1 and Num2. The division of Num1 and Num 2 is displayed in the Result field when the Divide button is clicked. If Num1 or Num2 were not an integer, the program would throw a Number Format Exception. If Num2 were ...

  5. JAVA APPLET PROGRAM TO HANDLE DIVIDE BY ZERO EXCEPTION

    If Num1 and Num2 were not an integer, The program would throw a NumberFormatException. If Num2 were zero, the program would throw ArithmeticException. Display the Exception in a message dialog box.

  6. java - How to do error message when I write double number in …

    Dec 13, 2015 · The program must contain an exception handler to catch ArithmeticException (e.g. divied by 0) and NumberFormatException (e.g., input is not an integer), display the errors in a message dialog box as shown below.

  7. java - Basic Calculator - Stack Overflow

    Feb 6, 2013 · Read the numbers from the dialog output instead of from System.in: String firstNumber = JOptionPane.showInputDialog(null,"please enter the first number"); if (firstNumber != null) { num1 = Integer.parseInt(firstNumber); }

  8. Write a Java program that creates a user interface to perform integer divisions. The user enters two numbers in the text fields, Num1 and Num2. The division of Num1 and Num 2 is displayed in the Result field when the Divide button is clicked. If Num1 or Num2 were not an integer, the program would throw a Number Format Exception. If Num2 were

  9. JP-LAB1 - JAVA - LAB PROGRAMS 1. Use Eclipse or Net bean

    4. Write a Java program that creates a user interface to perform integer divisions. The user enters two numbers in the text fields, Num1 and Num2. The division of Num1 and Num 2 is displayed in the Result field when the Divide button is clicked. If Num1 or Num2 were not an integer, the program would throw a Number Format Exception. If

    • Reviews: 3
    • java - Second JOptionPane.showInputDialog not opening - Stack Overflow

      Oct 14, 2015 · Here's the correct code: public static void main(String[] args) { double num1, num2; num1 = Double.parseDouble(JOptionPane.showInputDialog("Please input the first number")); num2 = Double.parseDouble(JOptionPane.showInputDialog("Please input the first number"));

    Refresh