A.Justice
09-08-2012, 09:10 PM
import javax.swing.JOptionPane ;
public class Pane {
public static void main(String[] args) {
JOptionPane.showMessageDialog(null, "Hi and welome to your death");
System.exit(0);
}
}
Simple Code for Java, but how does it work?
Good question buddy, I'll explain how the code works, starting from line one.
But Before I explain the code, I would like to recommend and IDE for you guys to get so you can code the code and compile it right there in the IDE.
Eclipse is a multi-language software development environment comprising an integrated development environment (IDE). Syntax Highlighting So yep a good thing.
Download Eclipse (http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/junor)
import javax.swing.JOptionPane ;
Imports JOption Class. JOptionPane Contains classes used for a graphical user interface (GUI), Input/output. JOptionPane allows you to
Allows you to create a dialog box(Similar to jScript Alert)
Display information
Request information
Give the user a choice with buttons
public class Pane {
public static void main(String[] args) {
Java public class "Pane" easy as that.The Main method is the method in which execution to any java program begins.
JOptionPane.showMessageDialog(null, "Hi and welome to your death");
System.exit(0);
In Simple terms, that basically shows the message in the quotation marks, null makes it so the user can exit(I'm not very sure about null in ths case).
Thanks for reading such a long tutorial on such a simple program.
*I'll edit this later, when I learn more about "null".*
public class Pane {
public static void main(String[] args) {
JOptionPane.showMessageDialog(null, "Hi and welome to your death");
System.exit(0);
}
}
Simple Code for Java, but how does it work?
Good question buddy, I'll explain how the code works, starting from line one.
But Before I explain the code, I would like to recommend and IDE for you guys to get so you can code the code and compile it right there in the IDE.
Eclipse is a multi-language software development environment comprising an integrated development environment (IDE). Syntax Highlighting So yep a good thing.
Download Eclipse (http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/junor)
import javax.swing.JOptionPane ;
Imports JOption Class. JOptionPane Contains classes used for a graphical user interface (GUI), Input/output. JOptionPane allows you to
Allows you to create a dialog box(Similar to jScript Alert)
Display information
Request information
Give the user a choice with buttons
public class Pane {
public static void main(String[] args) {
Java public class "Pane" easy as that.The Main method is the method in which execution to any java program begins.
JOptionPane.showMessageDialog(null, "Hi and welome to your death");
System.exit(0);
In Simple terms, that basically shows the message in the quotation marks, null makes it so the user can exit(I'm not very sure about null in ths case).
Thanks for reading such a long tutorial on such a simple program.
*I'll edit this later, when I learn more about "null".*