Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!

Glen Scheel

Greenhorn
+ Follow
since Nov 19, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Glen Scheel

OK, got it. Looks like fixing my last problem created this one.
Many thanks for the quick response.
Glen
16 years ago
Hello All,
Below is a short program that I beleive I have transcribed correctly. It is just intended as an introduction to simple GUI programming. It compiles fine but when I try to run it I get "Exception in thread "main" java.lang.NoClassDefFoundError: demoFlowLayout
import javax.swing.*;
import java.awt.*;
public class demoFlowLayout extends JFrame{

private JButton one, two, three;
private Container container;
public demoFlowLayout()
{
super("Demo Flow Layout");
container=getContentPane();
container.setLayout(new FlowLayout());
one=new JButton("one");
two=new JButton("two");
three=new JButton("three");
container.add(one);
container.add(two);
container.add(three);
setSize(200,100);
setVisible(true);
}
public static void main(String args[])
{
demoFlowLayout application = new demoFlowLayout();
application.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
I'm sure that I've made a simple error, but I just can't see it.
16 years ago
It's working now, Thanks!
Glen
16 years ago
Not to sound completely lost, but how do I add something to my classpath. What I've found online makes it seem like I can do it in the system applet of the control panel but slasspath is not one of the environment variables listed.
16 years ago
Hello All,
I have searched the message archive and not found an answer.
I have downloaded a class library that I need to make use of but I cannot seem to find any documentation on how to install it. I tried putting it into the 'include' folder but I am not able to access anything from the new library.
Any help will be greatly appreciated.
Glen
16 years ago
That was it. Thanks a ton!
Glen
16 years ago
Hello All,
I am just starting to learn Java. I am trying to learn on my own using the book "Java Programming Fundamentals" by Kimberly Seefeld. I like the book so far but I have run into a problem. I have typed up the following example program from the book:
// A simple program solving an equation with a variable.
public class solveForX2 {
public static void main (String args[])
{
int x=0;//variable is initialized
System.out.println("If x+3=8, what is x?");
x=8-3; //an equation to solve for x
System.out.println("x = " + x);
}
}
I save it as solveForX2.java and javac compiles it into solveForX2.class, but when I try to run it I get the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: solveForX2/class
I have checked it over multiple times and I cannot find any typos or mistakes on my part.
Can anyone tell me why this won't run?
Thanks,
Glen
16 years ago