Code: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
Imports JOption Class. JOptionPane Contains classes used for a graphical user interface (GUI), Input/output. JOptionPane allows you toCode:import javax.swing.JOptionPane ;
- Allows you to create a dialog box(Similar to jScript Alert)
- Display information
- Request information
- Give the user a choice with buttons
Java public class "Pane" easy as that.The Main method is the method in which execution to any java program begins.Code:public class Pane { public static void main(String[] args) {
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).Code:JOptionPane.showMessageDialog(null, "Hi and welome to your death"); System.exit(0);
Thanks for reading such a long tutorial on such a simple program.
*I'll edit this later, when I learn more about "null".*





Reply With Quote


