0
Please help me here im beginner
Import javaxswing.JOptionPaÂne; public class SampleProgram { public static void main (String [ ] args) { String firstName; String middleName; String lastName; firstName = JOptionPane.showInpuÂtDialog(âRodelynâ) middleName =JOptionPane.showInpÂutDialog(âCapinigâ) lastName = JOptionPane.showInpuÂtDialog(âHabocâ) JOptionPane.showInpuÂtDialog(null,âGoodDaÂyâ+firstNameââmiddleÂName+ââ+lastName); System.exit (0); } {
2 Answers
+ 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