About 324,000 results
Open links in new tab
  1. java - How to collect input from user with dialog box ... - Stack Overflow

    Oct 26, 2013 · "Ask the user to input a number. You should use an input dialog box for this input. Be sure to convert the String from the dialog box into a real number. The program needs to keep track of the smallest number the user entered as well as the largest number entered. Ask the user if they want to enter another number. If yes, repeat the process.

  2. Java JOptionPane - GeeksforGeeks

    Nov 7, 2023 · In Java Swing, JRootPane is a fundamental component that serves as the root container for creating complex user interfaces. It encapsulates the core functionality of a top-level window, like JFrame, and provides a structure for organizing the content within a GUI application.

  3. How to Make Dialogs (The Java™ Tutorials > Creating a GUI With …

    To create simple, standard dialogs, you use the JOptionPane class. The ProgressMonitor class can put up a dialog that shows the progress of an operation. Two other classes, JColorChooser and JFileChooser, also supply standard dialogs. To bring up …

  4. java - JOptionPane - input dialog box program - Stack Overflow

    Oct 10, 2012 · Write a program that uses input dialog boxes to read three test marks, each out of 100. The program discards your lowest mark and shows the average of the two higher marks in a message dialog box. This is how far i got and i dont know where to do from here, any help would be appreciated: public static void main (String [] args){

  5. Java User Input (Scanner class) - W3Schools

    The Scanner class is used to get user input, and it is found in the java.util package. To use the Scanner class, create an object of the class and use any of the available methods found in the Scanner class documentation. In our example, we will use …

  6. How to make an input form in Java code (not Netbeans using …

    I want to make an input form in Java so that the user can enter details. Something like this: import javax.swing.*; String[] items = {"One", "Two", "Three", "Four", "Five"}; JComboBox combo = new JComboBox(items); JTextField field1 = new JTextField("1234.56"); JTextField field2 = new JTextField("9876.54");

  7. Java Swing - JOptionPane showInputDialog example

    May 29, 2016 · With this method we can prompt the user for input while customizing our dialog window. The showConfirmDialog returns either String or Object and can be called using the following combinations of parameters: Object (returns String) – Shows a question-message dialog requesting input from the user.

  8. Java Syntax: Building an Input Dialog Box - ThoughtCo

    Jul 3, 2019 · Find out how to use Java syntax, specifically the showInputDialog method of the JOptionPane class, to make different kinds of input dialog boxes.

  9. Swing Examples - Show Input Dialog with Text Box - Online …

    Learn how to create and display an input dialog in Java Swing with examples. Enhance your GUI applications by capturing user input effectively.

  10. User input with a Java JOptionPane example - TheServerSide

    Sep 16, 2022 · With one simple line of code, Java’s JOptionPane enables a program to prompt the user with a Windows-based input dialog box, and return any user input as a String. var name = javax.swing.JOptionPane.showInputDialog("What is your name?");

Refresh