| | |
Java Homework help...JFrame
![]() |
•
•
Join Date: Nov 2007
Posts: 25
Reputation:
Solved Threads: 0
I really don't understand what I'm doing wrong. I've made windows before..and never have had this problem. The code complies fine, but when I run it I get this message..
java.lang.NoClassDefFoundError: smartMonster
Exception in thread "main"
right now all I want is a window to pop up with a button. I'm guessing it's an easy fix..but I've been working on it for awhile.
java.lang.NoClassDefFoundError: smartMonster
Exception in thread "main"
right now all I want is a window to pop up with a button. I'm guessing it's an easy fix..but I've been working on it for awhile.
Java Syntax (Toggle Plain Text)
import java.io.File; import static java.lang.System.out; import java.util.*; import java.io.IOException; import java.io.PrintStream; import javax.swing.*; import java.awt.*; import java.awt.event.*; class smartMonsterWindow extends JFrame { private JButton run; public static void main (String args[]) { JFrame smartMonsterWindow = new JFrame(); smartMonsterWindow.show(); // run(); } public smartMonsterWindow() //INSIDE WINDOW { //Make the Window setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE); setTitle ("SmartMonster"); setSize (200,300); setLocation (80,50); //Add the components Container contentPane = getContentPane(); contentPane.setLayout(new GridLayout (2, 2, 3, 3)); out.println ("Test"); //contentPane.add(new JLabel("this is a test")); JButton run = new JButton( "RUN" ); contentPane.add(run); } }
![]() |
Similar Threads
- Fractals and the Chaos Game help. (Java)
- java and using observable class (Java)
- Homework question (Java)
- homework(easy): Java GUI/Netbeans using java.util.LinkedList (Java)
- Problem with very basic homework... (It's done, but have one bug I can't figure out.) (Java)
- Homework Help (Java)
- Homework Help (Community Introductions)
- line up JTextField GUI java & write to file (Java)
Other Threads in the Java Forum
- Previous Thread: Administrator Login Probs
- Next Thread: Mission impossible! Find the bracket problem
| Thread Tools | Search this Thread |
3d 6 @param affinetransform android api applet application arc array arrays automation binary bluetooth bold byte c++ chat class client code color compare component coordinates database detection doctype eclipse educational error file fractal froglogic game givemetehcodez graphics gui guitesting helpwithhomework html ide ideas image ingres input integer internet intersect j2me java java.xls javaexcel javaprojects jni jpanel jtextarea julia keytool keyword linux list loop map method methods mobile netbeans newbie nextline object pong print problem producer program programming project projectideas read recursion recursive replaysolutions rim scanner sell server set size sms sort sql string swing terminal threads tree web websites windows






