im trying to program a JAVA GUI but after i compile the code and try to run it i get an error message. i then downloaded a program i made at college and i get the same problem even though it ran at the university.
Heres the Code

import java.awt.*;
import javax.swing.*;

class fm1 extends JPanel
{
	public static void main (String[]args)
	{
		JFrame fruitMachine = new JFrame("Fruit Machine");
		fruitMachine.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		fruitMachine.setSize(300,900);

		JLabel fruit1 = new JLabel();
		fruitMachine.add(fruit1);

		JLabel fruit2 = new JLabel();
 		fruitMachine.add(fruit2);

		JLabel fruit3 = new JLabel();
		fruitMachine.add(fruit3);

		fruitMachine.pack();
		fruitMachine.setVisible(true);
	}
}

Is there something wrong with the code or is it my computer

sorry about this... i know whats wrong now, i forgot that i had a test file for the older program which is why the it woudnt run.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.