+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Hello World - GUI

  1. #1
    Khaotic is offline Learning Programmer
    Join Date
    Apr 2009
    Location
    Brandon, Mississippi, United States
    Posts
    62
    Rep Power
    12

    Hello World - GUI

    Well just so I get back into the groove of making tutorials, I am going to make a quick Hello World graphical user interface window. I'm not with my compiler right now and it has been a few weeks since I have worked on a GUI (currently working on an IRCd made in java with services written in tcl{i know lol}

    Alright here we go.

    Code:
    import javax.swing.*; 
    
    import java.awt.*; 
    
    import java.awt.event.*; 
    
    public class helloWorld extends JFrame {
        helloWorld(String title) { 
            this.setSize(500,500); 
            setTitle(title); 
        }
    
        public static void main(String[] args) {
           helloWorld window = new helloWorld("Hello CodeCall");
           window.setVisible(true);
           window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 
        }
    }
    Basically this opens a 500x500 window titled "Hello CodeCall"

    Please remember I did this without my compiler(yes, I know this is simple, but also consider I havent done a GUI in a matter of weeks, if not months)
    Last edited by Khaotic; 07-13-2010 at 12:55 PM.
    Check out my site: www.khaoticirc.net

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    Lions is offline Newbie
    Join Date
    Jun 2010
    Posts
    6
    Rep Power
    0

    Re: Hello World - GUI

    Thanks for this, helped me out!

  4. #3
    isuru's Avatar
    isuru is offline Programming Professional
    Join Date
    May 2010
    Posts
    228
    Rep Power
    8

    Re: Hello World - GUI

    Thanks! Keep Posting!

  5. #4
    fyhring4 is offline Newbie
    Join Date
    Jan 2009
    Location
    Denmark
    Posts
    13
    Rep Power
    0

    Re: Hello World - GUI

    Thx vervy nice

  6. #5
    femi is offline Newbie
    Join Date
    Dec 2010
    Posts
    4
    Rep Power
    0

    Re: Hello World - GUI

    Nice one. what if i want to write A GUI password programme?

  7. #6
    Join Date
    Jun 2010
    Location
    Vancouver, Eh.
    Posts
    4,020
    Blog Entries
    7
    Rep Power
    39

    Re: Hello World - GUI

    Quote Originally Posted by femi View Post
    Nice one. what if i want to write A GUI password programme?
    Java has an awesome tutorial to mask input and things: Password Masking in the Java Programming Language
    Be sure to read the updated FAQ || Health is achieved through 10,000 different steps.
    A textual description can be only part of your question, be sure to provide sample results, errors and your platform in the appropriate forums while asking.

  8. #7
    femi is offline Newbie
    Join Date
    Dec 2010
    Posts
    4
    Rep Power
    0
    Thank you

    Hi Nullw0rm but the code is not running on BlueJ
    Last edited by Alexander; 12-03-2010 at 06:41 PM. Reason: Merged three posts

  9. #8
    Join Date
    Jun 2010
    Location
    Vancouver, Eh.
    Posts
    4,020
    Blog Entries
    7
    Rep Power
    39

    Re: Hello World - GUI

    It uses AWT/Swing, so you may need to edit it a bit to get it to work. There are other password input tutorials on the web too if you search which are quite nice. Try not to create so many posts in one place!
    Be sure to read the updated FAQ || Health is achieved through 10,000 different steps.
    A textual description can be only part of your question, be sure to provide sample results, errors and your platform in the appropriate forums while asking.

  10. #9
    femi is offline Newbie
    Join Date
    Dec 2010
    Posts
    4
    Rep Power
    0

    Re: Hello World - GUI

    okay . thank you

  11. #10
    Walizzay is offline Newbie
    Join Date
    Jun 2011
    Posts
    5
    Rep Power
    0

    Re: Hello World - GUI

    You dont need these imports:
    Code:
    import java.awt.*;
    import java.awt.event.*;
    The code can run on Swing by itself.

+ Reply to Thread
Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 9
    Last Post: 01-14-2011, 12:59 PM
  2. Hello world
    By hadesthanos in forum Introductions
    Replies: 10
    Last Post: 12-18-2009, 02:52 PM
  3. Hello World
    By prajmus in forum Introductions
    Replies: 12
    Last Post: 12-09-2009, 08:49 AM
  4. hello world !!!
    By cipher in forum Introductions
    Replies: 18
    Last Post: 07-23-2008, 07:53 AM
  5. Hello World
    By aurelABHR in forum C and C++
    Replies: 6
    Last Post: 07-01-2008, 04:16 AM

Tags for this Thread

Bookmarks

Posting Permissions

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