slightlyoff
asked on
Java Swing not working...
I'm a beginner to Java and was trying to complete a Swing tutorial. I entered the code and ran it, but did not get the pop up window as the tutorial suggested i would.
Not sure what's not included in my code or files. I don't have any errors showing up in Eclipse. I have one warning: The serializable class Simple does not declare a static final serialVersionUID field of type long - but i don't think that's the problem. When I run the code I get the following in the Console area of the Eclipse IDE:
Usage: javaw [-options] class [args...]
(to execute a class)
or javaw [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-server to select the "server" VM
-hotspot is a synonym for the "server" VM [deprecated]
The default VM is server.
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -jre-no-restrict-search
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<cl assname>]
-enableassertions[:<packag ename>...| :<classnam e>]
enable assertions
-da[:<packagename>...|:<cl assname>]
-disableassertions[:<packa gename>... |:<classna me>]
disable assertions
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<opti ons>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<op tions>]
load native agent library by full pathname
-javaagent:<jarpath>[=<opt ions>]
load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
show splash screen with specified image
I've attached my code below. Any help would be appreciated! Thanks!
Not sure what's not included in my code or files. I don't have any errors showing up in Eclipse. I have one warning: The serializable class Simple does not declare a static final serialVersionUID field of type long - but i don't think that's the problem. When I run the code I get the following in the Console area of the Eclipse IDE:
Usage: javaw [-options] class [args...]
(to execute a class)
or javaw [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-server to select the "server" VM
-hotspot is a synonym for the "server" VM [deprecated]
The default VM is server.
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose[:class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -jre-no-restrict-search
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<cl
-enableassertions[:<packag
enable assertions
-da[:<packagename>...|:<cl
-disableassertions[:<packa
disable assertions
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<opti
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<op
load native agent library by full pathname
-javaagent:<jarpath>[=<opt
load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
show splash screen with specified image
I've attached my code below. Any help would be appreciated! Thanks!
package jSwing;
import javax.swing.JFrame;
public class Simple extends JFrame {
public Simple() {
setSize(300, 200);
setTitle("Simple");
setDefaultCloseOperation(EXIT_ON_CLOSE);
}
public static void main(String[] args) {
Simple simple = new Simple();
simple.setVisible(true);
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER