the nhonoured tradition of hello world in a dialog box
a simple dialog box using swing
import javax.swing.JOptionPane;
public class Tester {
public static void main(String[] args) {
JOptionPane.showMessageDialog(null
Bookmark It
|
|||||
|
the nhonoured tradition of hello world in a dialog box a simple dialog box using swing import javax.swing.JOptionPane; public class Tester { public static void main(String[] args) { JOptionPane.showMessageDialog(null Bookmark It this example accepts users input using the input dialog box and then displays a message accept users input using input dialog box import javax.swing.JOptionPane; public class Tester { public static void main(String[] args) { String name; //get users name using input dialog box name = JOptionPane.showInputDialog("Please enter your name"); //display users name JOptionPane.showMessageDialog(null Bookmark It process user input and add 2 numbers then display the result user input simple calculation example import javax.swing.JOptionPane; public class Tester { public static void main(String[] args) { String Number1; String Number2; int num1; int num2; int result; //get users name using input dialog box Number1 = JOptionPane.showInputDialog("Please enter number 1"); Number2 = JOptionPane.showInputDialog("Please enter number 2"); [...] |
|||||
|
Copyright © 2012 Programmingsite : source code - All Rights Reserved |
|||||