Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

get input in java using joptionpane

import javax.swing.JOptionPane;

public class Sample {
    public static void main(String[] args) {
        String name = "";
        name = JOptionPane.showInputDialog("Please Enter your name");
        String msg = "Hello " + name + "!";
        JOptionPane.showMessageDialog(null, msg);
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: Unable to locate a Java Runtime that supports apt. 
Java :: minecraft plugin send all players message 
Java :: java number padding zeros 
Java :: sort array<entry float android studio 
Java :: decimal format 
Java :: pyramid star pattern in java 
Java :: material design android dependency androidx 
Java :: java write string 
Java :: How to efficiently find a target element in a sorted matrix of distinct ints, in Java? 
Java :: set vs list java 
Java :: scanner in java 
Java :: Youtube video thumbnail not load in android 11 or above progmatically 
Java :: number regex java 
Java :: android action key 
Java :: java loop through arraylist 
Java :: change material fab color android 
Java :: how to byheart faster 
Java :: list to observablelistz 
Java :: circular list java 
Java :: how to preset a list java 
Java :: spring url parameter 
Java :: How to efficiently generate all combinations of well-formed parentheses for n pairs of them, in Java? 
Java :: convert class to xml string 
Java :: how to import jframe in java 
Java :: androidx.fragment.app.Fragment$InstantiationException: Unable to instantiate fragment com.example.kodakjhelum.ItemFragment: make sure class name exists 
Java :: greatest common divisor java 
Java :: java int to hex 
Java :: array to arraylist 
Java :: install java 8 arch 
Java :: min of an array java 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =