-
Gui Q
Hello all,
I'm stuck on a project. Its Java based, to do GUI's.
I've written some code which details size, colour, labels and buttons, (but i have not yet assigned tasks to each button)
...
import java.awt.*;
class FirstFrame extends Frame
{
FirstFrame()
{
super("Test Frame GUI");
buildGUI();
setSize(200,60);
setVisible(true);
}
private void buildGUI()
{
Panel top = new Panel();
top.setLayout(new BorderLayout());
top.add(new Label("Load File: "),
BorderLayout.WEST);
top.add(new TextField(),
BorderLayout.CENTER);
top.add(new Button("Load"),
BorderLayout.EAST);
add(top, BorderLayout.NORTH);
add(new TextArea(20,50),
BorderLayout.CENTER);
Panel right = new Panel();
right.setLayout(new GridLayout(3,1));
}
}
First problem is, i'm getting the error message,
"Exception in thread "main" java.lang.NoClassDefFoundError: TestFrame"
Can anyone let me know what thats about?
The end result will be that i'll need to set it up to return a Truth Table for a user inputted mathematical equation! If anyone can help out with that as well that be great!
WannaJava
-
"Exception in thread "main" java.lang.NoClassDefFoundError: TestFrame"
Well that exception means that when you tried to invoke the program it couldnt actualy find the class you told it to start the main method in. This is quite often caused by either a) trying to run a class from a package which isnt the default one in correctly or b) File name cases or c) class path problems
In your case my guess would be that eithre you have got the cases in the filename wrong (should be FirstFrame.java) or that you don't have . in your class path. (Dot represnts the current directory)
Alan
-
Originally posted by awoodland
In your case my guess would be that eithre you have got the cases in the filename wrong (should be FirstFrame.java) or that you don't have . in your class path. (Dot represnts the current directory)
Hello,
Thanks for taking the time to reply.
About this you wrote, in practice what does this mean for me. How will i change my code to correct it?
Sorry if it seems all very beginner, but it's got me stumped for a while now
Thanks in advance, WJ
It's not the critic who counts. It's not the man who points out how the strong man stumbles, or where the doer of the deed could have done it better. The credit belongs to the man in the arena, whose face is marred by dust and sweat and blood, who spends himself in a worthy cause, who strives vailantly, who errs and come up short again and again, who at best knows the high achievement of triumph, who at worst, fails while daring greatly for he knows his place shall never be with those cold and timid souls who know neither victory no defeat.
--Theodore Roosevelt
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