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); } {

10th Oct 2018, 12:40 PM
Lars Cullen
Lars Cullen - avatar
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
10th Oct 2018, 2:28 PM
JavaBobbo
JavaBobbo - avatar
+ 1
thank you so much
11th Oct 2018, 6:34 AM
Lars Cullen
Lars Cullen - avatar