0
Please help me here im beginner
Import javaxswing.JOptionPane; public class SampleProgram { public static void main (String [ ] args) { String firstName; String middleName; String lastName; firstName = JOptionPane.showInputDialog(“Rodelyn”) middleName =JOptionPane.showInputDialog(“Capinig”) lastName = JOptionPane.showInputDialog(“Haboc”) JOptionPane.showInputDialog(null,”GoodDay”+firstName””middleName+””+lastName); System.exit (0); } {
2 Réponses
+ 1
Here you have my friend.
import javax.swing.*;
public class SampleProgram {
public static void main(String[] args) {
String firstName = JOptionPane.showInputDialog(null,"Enter first name");
String middleName = JOptionPane.showInputDialog(null,"Enter middle name");
String lastName = JOptionPane.showInputDialog(null,"Enter last name");
JOptionPane.showMessageDialog(null,"GoodDay "+firstName+" "+middleName+" "+lastName);
}
}
To get the input from user use showInputDialog method
To get the output use showMessageDialog method
And the ''null'' will get the dialog box to the center of the screen
+ 1
thank you so much