Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 7 of 7
  1. #1

    Default [TUT] Java JOptionPane [Java]

    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



    Code:
    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


    Code:
    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.

    Code:
    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".*

  2. #2

    Default

    Quick update, Null means that the value is unknown(just learned that).

  3. #3
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    Just for reference that first parameter is for the parentComponent, if it's not known or there is no extra frame null will have it use the default frame.

  4. #4

    Default

    Quote Originally Posted by Dentafrice View Post
    Just for reference that first parameter is for the parentComponent, if it's not known or there is no extra frame null will have it use the default frame.
    Oh, and since you know something about Java can you tell me I have one question, Can you tell which version of Java I'm using?

  5. #5
    Join Date
    Oct 2011
    Location
    /home/
    Posts
    127
    Tokens
    0

    Default

    Does it really matter, seriously?

  6. #6

    Default

    Quote Originally Posted by Jutnux View Post
    Does it really matter, seriously?
    What?!?

  7. #7
    Join Date
    Mar 2008
    Posts
    5,108
    Tokens
    3,780

    Latest Awards:

    Default

    Max or linux:
    java -version

    java version "1.6.0_33"Java(TM) SE Runtime Environment (build 1.6.0_33-b03-424-11M3720)
    Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03-424, mixed mode)
    Windows:
    http://javatester.org/version.html

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •