using Eclipse with visual editor

Discussion in 'Java' started by Mr. X., Feb 28, 2008.

  1. Mr. X.

    Mr. X. Guest

    Hello,

    First time I have used eclipse with visual editor.

    When put on screen a dialog component,
    and some jbutton on it.

    I have tried to run the application
    (run as java application).

    What I get is the message :
    selection does not contain a main type.

    I think this is basic thing of some declarations ...

    What may be the problem ?

    Thanks :)
     
    Mr. X., Feb 28, 2008
    #1
    1. Advertising

  2. Mr. X.

    Pushkaraj Guest

    On Feb 28, 9:21 am, "Mr. X." <no_spam_please@nospam_please.com> wrote:
    > Hello,
    >
    > First time I have used eclipse with visual editor.
    >
    > When put on screen a dialog component,
    > and some jbutton on it.
    >
    > I have tried to run the application
    > (run as java application).
    >
    > What I get is the message :
    > selection does not contain a main type.
    >
    > I think this is basic thing of some declarations ...
    >
    > What may be the problem ?
    >
    > Thanks :)


    Hi, Its very easy, till now you would have figure out yourself.
    Its about the public static void main(String args[]), there no method
    with this signature in the class! then form where the program should
    start execution. :)
     
    Pushkaraj, Feb 28, 2008
    #2
    1. Advertising

  3. Mr. X.

    Mr. X. Guest

    Thanks.

    What should I put on main.
    See following (see remarks on main function ...)

    public class dlgMain extends JDialog {
    ....
    private dlgMain myDlg;

    public dlgMain(Frame owner) {

    super(owner);

    initialize();

    }

    public static void main(String args[])

    {

    // **** here is the problem.

    // **** null is not OK.

    myDlg = new dlgMain(null); // null is not O.K , but still I want to show
    the dialog (that Eclipse has done with the visual editor).

    }

    private void initialize() {

    this.setSize(300, 200);

    this.setContentPane(getJContentPane());

    }

    ....





    Thanks : )
     
    Mr. X., Feb 29, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Erik Danielsson

    Eclipse Visual Editor

    Erik Danielsson, Dec 13, 2003, in forum: Java
    Replies:
    6
    Views:
    3,619
    Erik Danielsson
    Jan 16, 2004
  2. Stylus Studio
    Replies:
    0
    Views:
    767
    Stylus Studio
    Aug 3, 2004
  3. ted holden

    Eclipse, Visual Editor, JMF usage

    ted holden, Oct 25, 2004, in forum: Java
    Replies:
    0
    Views:
    542
    ted holden
    Oct 25, 2004
  4. joe
    Replies:
    2
    Views:
    4,165
    Thomas G. Marshall
    Jan 8, 2005
  5. wensa
    Replies:
    1
    Views:
    3,334
    IchBin
    Feb 15, 2006
Loading...

Share This Page