-
Help with NoSuchMethodError:
hey guys new java programmer (hopefully) looking for a little guideness here.
if just cannot get any program to run off of JCreator to run at all, even the samples that come with the program or source code from the net.
everytime it loads fine untill in the Dos window (for lack of me knowing a better word) i get "Exception in thread "main" java.lang.NoSuchMethodError: main
Press any key to continue...
Heres the code:
import java.awt.*;
import java.awt.event.*;
public class MyFirstFrame extends Frame {
public MyFirstFrame() {
MenuBar menuBar = new MenuBar();
Menu menuFile = new Menu();
MenuItem menuFileExit = new MenuItem();
menuFile.setLabel("File");
menuFileExit.setLabel("Exit");
// Add action listener.for the menu button
menuFileExit.addActionListener
(
new ActionListener() {
public void actionPerformed(ActionEvent e) {
MyFirstFrame.this.windowClosed();
}
}
);
menuFile.add(menuFileExit);
menuBar.add(menuFile);
setTitle("MyFirst");
setMenuBar(menuBar);
setSize(new Dimension(400, 400));
// Add window listener.
this.addWindowListener
(
new WindowAdapter() {
public void windowClosing(WindowEvent e) {
MyFirstFrame.this.windowClosed();
}
}
);
}
protected void windowClosed() {
System.exit(0);
}
}
Could use any help you wise sages could give thx.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks