Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2008

Tip: Looking for answers? Try searching our database.

using Eclipse with visual editor

Thread view: 
Mr. X. - 28 Feb 2008 04:21 GMT
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 :)
Pushkaraj - 28 Feb 2008 04:55 GMT
> Hello,
>
[quoted text clipped - 14 lines]
>
> 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. :)
Mr. X. - 29 Feb 2008 15:11 GMT
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 : )


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.