Results 1 to 7 of 7
  1. #1
    doobybug is offline Member
    Join Date
    Mar 2008
    Posts
    17
    Rep Power
    0

    Default Java GUI Basic Book

    Hi all,

    So I have became quite familiar with the basis of Object Orientation and I want to learn some GUI. Any idea of a good online book so that I can teach myself and do some examples? This is my first time with GUI so nothing too complex please

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,969
    Rep Power
    8

    Default

    Have you read through the Swing tutorial? That's where I would start if I were you.

    Trail: Creating a GUI With JFC/Swing (The Javaô Tutorials)
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    doobybug is offline Member
    Join Date
    Mar 2008
    Posts
    17
    Rep Power
    0

    Default

    With the first program Hello World I am already at lost that is why I am asking

  4. #4
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,969
    Rep Power
    8

    Default

    I'm confused. If you're lost on Hello World, how do you expect to jump into programming a GUI? How can you be quite familiar with OO but unable to write Hello World?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #5
    doobybug is offline Member
    Join Date
    Mar 2008
    Posts
    17
    Rep Power
    0

    Default

    This is the hello world I am referring to:

    Java Code:
     import javax.swing.*;        
    
    public class HelloWorldSwing {
        /**
         * Create the GUI and show it.  For thread safety,
         * this method should be invoked from the
         * event-dispatching thread.
         */
        private static void createAndShowGUI() {
            //Create and set up the window.
            JFrame frame = new JFrame("HelloWorldSwing");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    
            //Add the ubiquitous "Hello World" label.
            JLabel label = new JLabel("Hello World");
            frame.getContentPane().add(label);
    
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        }
    
        public static void main(String[] args) {
            //Schedule a job for the event-dispatching thread:
            //creating and showing this application's GUI.
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
                }
            });
        }
    }
    For example what is contentPane? It never explains line by line! or the pack() method? That is why I usually don't go for the Oracle tutorials as they take things foregranted

  6. #6
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,969
    Rep Power
    8

    Default

    They "take things for granted" because any of that is easily "googlable", or even simpler, available and well documented in the API.

    The API is your new best friend: Java Platform SE 6
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  7. #7
    doobybug is offline Member
    Join Date
    Mar 2008
    Posts
    17
    Rep Power
    0

    Default

    Ok thanks a lot ... I was thinking about something more basic as I am totally new to this. Guess everyone forgets what it means to struggle to understand and not finding any help! :S

Similar Threads

  1. Java Book Recommendations
    By regor in forum New To Java
    Replies: 2
    Last Post: 02-07-2011, 07:27 AM
  2. Java 2 book, is it outdated?
    By Coulihan in forum New To Java
    Replies: 2
    Last Post: 01-20-2011, 11:37 PM
  3. looking for a java book
    By fishandchips in forum New To Java
    Replies: 7
    Last Post: 05-27-2010, 06:04 AM
  4. Replies: 2
    Last Post: 01-16-2010, 04:50 PM
  5. Tell me about the best book for Java.
    By CS Geek in forum New To Java
    Replies: 12
    Last Post: 08-31-2008, 05:18 AM

Posting Permissions

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