Jump to content

[SOLVED] Weird Java error


jordanwb

Recommended Posts

I've never got this error before: NoClassDefFoundError.

 

This is the game class:

 

import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
import java.util.ArrayList;

public class Game extends JFrame
{
    private Container c;
    
    public Game()
    {
        this.c = this.getContentPane ();
        this.c.setLayout (new FlowLayout ());
        
        Scrabble_Square button = new Scrabble_Square (); <---- Error on this line
        button.set_letter ("l", Scrabble_Square.Wild_Text_Color);
        
        this.c.add (button);
        
        this.setVisible (true);
    }
}

 

Scrabble_Square class:

 

import javax.swing.*;
import javax.swing.event.*;
import java.awt.*;
import java.awt.event.*;
import java.util.ArrayList;

public class Scrabble_Square extends JButton
{
    public static Color Square_Color = new Color (0x62, 0x144, 0x228);
    public static Color Default_Text_Color = Color.BLACK;
    public static Color Wild_Text_Color = Color.RED;
    public static Dimension Size = new Dimension (50, 50);
    
    private String letter;
    
    public Scrabble_Square()
    {
        this.setBackground (Scrabble_Square.Square_Color);
        this.setPreferredSize (Scrabble_Square.Size);
    }
    
    public void set_letter (String letter, Color color)
    {
        this.letter = letter;
        this.setEnabled (false);
        this.setForeground (color);
    }
}

 

I'm using Java 1.6.3 and BlueJ 2.2.1

Link to comment
https://forums.phpfreaks.com/topic/87982-solved-weird-java-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.