Results 1 to 4 of 4
  1. #1
    marie is offline Member
    Join Date
    Mar 2010
    Posts
    7
    Rep Power
    0

    Default need code explanation

    m currently doing a project named domotics.. what does the following code mean or performs what action?
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {

    public void run() {
    new Domotics().setVisible(true);
    }
    });
    }

  2. #2
    marie is offline Member
    Join Date
    Mar 2010
    Posts
    7
    Rep Power
    0

    Default

    need to know specially the second statement

  3. #3
    dunafrothint is offline Member
    Join Date
    Oct 2009
    Posts
    26
    Rep Power
    0

    Default

    The main creates a new Runnable, which allows for a Run() that will invoke on the start-up of the application. The new Domotics().setVisible(true); creates a new instance of Domotics, which I assume extends a Frame, Panel, Form, etc. and makes the application/applet visible.

    Hope that helps!

    ~Jamie

  4. #4
    FON
    FON is offline Senior Member
    Join Date
    Dec 2009
    Location
    Belgrade, Serbia
    Posts
    366
    Rep Power
    6

    Default

    I guess that code was automatically created for you
    after you have created some frame...

    You have to understand java thread mechanism behind this in AWT and Swing.

    Here is link to give you an idea:

    Java AWT/Swing event queue

Similar Threads

  1. explanation of this loop?
    By glopez09 in forum New To Java
    Replies: 4
    Last Post: 11-15-2009, 03:36 AM
  2. Quick Sort explanation.
    By hawaiifiver in forum New To Java
    Replies: 4
    Last Post: 03-10-2009, 03:28 AM
  3. Class explanation
    By mcal in forum New To Java
    Replies: 1
    Last Post: 02-05-2008, 07:50 PM
  4. need a little explanation
    By cew27 in forum New To Java
    Replies: 7
    Last Post: 12-14-2007, 12:39 AM
  5. I need didactic explanation
    By Eric in forum New To Java
    Replies: 2
    Last Post: 07-02-2007, 06:37 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
  •