using Eclipse with visual editor

M

Mr. X.

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 :)
 
P

Pushkaraj

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. :)
 
M

Mr. X.

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

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top