Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ultra noob problem

 
Keenan Staffieri
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I try to compile a JPanel App, and I get this error for some reason! I'm using java sdk 1.5, and runtime 1.5(the most uptodate one) and im getting this problem. My applet programs run fine, but I cant seem to get JPanel to work, thanx. And this should run, because JBuilder created this for me.

http://img251.imageshack.us/my.php?image=1sk9.jpg
[ July 24, 2006: Message edited by: Keenan Staffieri ]
 
Giovanni De Stefano
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...read the messages area: "No such method found: main" basically you either didn't write a main or it cannot be found!

If you post your code qould be much easier to debug!

Gio :-)
 
Keenan Staffieri
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I saw that before, and know that a program needs a main(String[] args) to run if its an app. Yet I find it strange that it would not be there, I thought JBuilder would auto-create this so I could run it immeditaly and an intro.

CODE:


 
Rusty Shackleford
Ranch Hand
Posts: 490
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would it auto-create a main method? Would the IDE know what should be in main? Add main, and call Panel test from there.

Also show() is deprecated and should never be used, use setVisible(true) instead.
[ July 24, 2006: Message edited by: Rusty Shackleford ]
 
Keenan Staffieri
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
eh, nvm.

The tutorials I am utilizing work anyway.

When I said JBuilder made this, I meant it in that, when you create a new file in JBuilder it has stuff already there for you to compile and see, as a sample, but i find it weird it has no main.
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you check the Generate Main Method option in the JBuilder New Class Wizard ?
Not all classes require a main method, therefore JBuilder is not going to create one unless you tell it to.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic