Running an Application w/ a frame through an MS-DOS prompt

T

Ted

Hello all--

I've written a Java App that utilizes a frame component (rather than an
applet) as my container. The frame is created in one class and I add a
panel created in another class to it.

I.e.:
-public class Dice creates a JFrame to which I add a DicePanel.
-public class DicePanel is an extension of the JPanel class, and
includes all of my listeners, etc.

I know you'd launch a normal Java app (by normal, I mean w/o any
components) by typing into an MS-DOS prompt "java [classfile]", but
when I do this w/ my Dice class, it doesn't work. The project compiles
and runs correctly in the IDE (Netbeans 3.6), but not through DOS.
Anyone know how to do this?

FYI, my end-goal is to create an MS-DOS shortcut to run the
application.

Thanks a lot.
 
T

Ted

Thanks, but I was hoping to not have to rework the code too much, and
I'm not sure about how to use widgets (this is one of my first gui
apps).

I should also mention that both classes are part of the same package.

This is the error message I get when I try to run the class:

Exception in thread "main" java.lang.NoClassDefFoundError: Die (wrong
name: RiggedDie/Die)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)

Not sure if that helps. Thanks a lot.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top