Results 1 to 9 of 9
  1. #1
    Xyexs is offline Member
    Join Date
    Apr 2013
    Posts
    36
    Rep Power
    0

    Default Renamed project and got loads of errors...

    As stated in the title i renamed an eclipse project (I think...) ...
    Note that i have made a new project and copied the code and still get the error

    here's the console

    Java Code:
    Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
    	at xyexs.snake.src.Panel.paintComponent(Panel.java:16)
    	at javax.swing.JComponent.paint(Unknown Source)
    	at javax.swing.JComponent.paintChildren(Unknown Source)
    	at javax.swing.JComponent.paint(Unknown Source)
    	at javax.swing.JComponent.paintChildren(Unknown Source)
    	at javax.swing.JComponent.paint(Unknown Source)
    	at javax.swing.JLayeredPane.paint(Unknown Source)
    	at javax.swing.JComponent.paintChildren(Unknown Source)
    	at javax.swing.JComponent.paintToOffscreen(Unknown Source)
    	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
    	at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
    	at javax.swing.RepaintManager.paint(Unknown Source)
    	at javax.swing.JComponent.paint(Unknown Source)
    	at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
    	at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
    	at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
    	at java.awt.Container.paint(Unknown Source)
    	at java.awt.Window.paint(Unknown Source)
    	at javax.swing.RepaintManager$3.run(Unknown Source)
    	at javax.swing.RepaintManager$3.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.access$1000(Unknown Source)
    	at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)
    	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    	at java.awt.EventQueue.access$200(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    	at java.awt.EventQueue.dispatchEvent(Unknown Source)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.lang.IllegalArgumentException: Color parameter outside of expected range: Red
    	at java.awt.Color.testColorValueRange(Unknown Source)
    	at java.awt.Color.<init>(Unknown Source)
    	at java.awt.Color.<init>(Unknown Source)
    	at xyexs.snake.src.Reference.<clinit>(Reference.java:16)
    	... 41 more
    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class xyexs.snake.src.Reference
    	at xyexs.snake.src.Panel.paintComponent(Panel.java:16)
    	at javax.swing.JComponent.paint(Unknown Source)
    	at javax.swing.JComponent.paintChildren(Unknown Source)
    	at javax.swing.JComponent.paint(Unknown Source)
    	at javax.swing.JComponent.paintChildren(Unknown Source)
    	at javax.swing.JComponent.paint(Unknown Source)
    	at javax.swing.JLayeredPane.paint(Unknown Source)
    	at javax.swing.JComponent.paintChildren(Unknown Source)
    	at javax.swing.JComponent.paintToOffscreen(Unknown Source)
    	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
    	at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
    	at javax.swing.RepaintManager.paint(Unknown Source)
    	at javax.swing.JComponent.paint(Unknown Source)
    	at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
    	at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
    	at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
    	at java.awt.Container.paint(Unknown Source)
    	at java.awt.Window.paint(Unknown Source)
    	at javax.swing.RepaintManager$3.run(Unknown Source)
    	at javax.swing.RepaintManager$3.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.access$1000(Unknown Source)
    	at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)
    	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    	at java.awt.EventQueue.access$200(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    	at java.awt.EventQueue.dispatchEvent(Unknown Source)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    	at java.awt.WaitDispatchSupport$2.run(Unknown Source)
    	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    	at java.awt.EventQueue.access$200(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    	at java.awt.EventQueue.dispatchEvent(Unknown Source)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.run(Unknown Source)
    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class xyexs.snake.src.Reference
    	at xyexs.snake.src.Panel.paintComponent(Panel.java:16)
    	at javax.swing.JComponent.paint(Unknown Source)
    	at javax.swing.JComponent.paintChildren(Unknown Source)
    	at javax.swing.JComponent.paint(Unknown Source)
    	at javax.swing.JComponent.paintChildren(Unknown Source)
    	at javax.swing.JComponent.paint(Unknown Source)
    	at javax.swing.JLayeredPane.paint(Unknown Source)
    	at javax.swing.JComponent.paintChildren(Unknown Source)
    	at javax.swing.JComponent.paintToOffscreen(Unknown Source)
    	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
    	at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
    	at javax.swing.RepaintManager.paint(Unknown Source)
    	at javax.swing.JComponent.paint(Unknown Source)
    	at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
    	at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
    	at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
    	at java.awt.Container.paint(Unknown Source)
    	at java.awt.Window.paint(Unknown Source)
    	at javax.swing.RepaintManager$3.run(Unknown Source)
    	at javax.swing.RepaintManager$3.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.access$1000(Unknown Source)
    	at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)
    	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    	at java.awt.EventQueue.access$200(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    	at java.awt.EventQueue.dispatchEvent(Unknown Source)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    	at java.awt.WaitDispatchSupport$2.run(Unknown Source)
    	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    	at java.awt.EventQueue.access$200(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    	at java.awt.EventQueue.dispatchEvent(Unknown Source)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.run(Unknown Source)
    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class xyexs.snake.src.Reference
    	at xyexs.snake.src.Panel.paintComponent(Panel.java:16)
    	at javax.swing.JComponent.paint(Unknown Source)
    	at javax.swing.JComponent.paintChildren(Unknown Source)
    	at javax.swing.JComponent.paint(Unknown Source)
    	at javax.swing.JComponent.paintChildren(Unknown Source)
    	at javax.swing.JComponent.paint(Unknown Source)
    	at javax.swing.JLayeredPane.paint(Unknown Source)
    	at javax.swing.JComponent.paintChildren(Unknown Source)
    	at javax.swing.JComponent.paintToOffscreen(Unknown Source)
    	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
    	at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
    	at javax.swing.RepaintManager.paint(Unknown Source)
    	at javax.swing.JComponent.paint(Unknown Source)
    	at java.awt.GraphicsCallback$PaintCallback.run(Unknown Source)
    	at sun.awt.SunGraphicsCallback.runOneComponent(Unknown Source)
    	at sun.awt.SunGraphicsCallback.runComponents(Unknown Source)
    	at java.awt.Container.paint(Unknown Source)
    	at java.awt.Window.paint(Unknown Source)
    	at javax.swing.RepaintManager$3.run(Unknown Source)
    	at javax.swing.RepaintManager$3.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.access$1000(Unknown Source)
    	at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)
    	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    	at java.awt.EventQueue.access$200(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    	at java.awt.EventQueue.dispatchEvent(Unknown Source)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.run(Unknown Source)
    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class xyexs.snake.src.Reference
    	at xyexs.snake.src.Panel.paintComponent(Panel.java:16)
    	at javax.swing.JComponent.paint(Unknown Source)
    	at javax.swing.JComponent.paintToOffscreen(Unknown Source)
    	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
    	at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
    	at javax.swing.RepaintManager.paint(Unknown Source)
    	at javax.swing.JComponent._paintImmediately(Unknown Source)
    	at javax.swing.JComponent.paintImmediately(Unknown Source)
    	at javax.swing.RepaintManager$3.run(Unknown Source)
    	at javax.swing.RepaintManager$3.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.access$1000(Unknown Source)
    	at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)
    	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    	at java.awt.EventQueue.access$200(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    	at java.awt.EventQueue.dispatchEvent(Unknown Source)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.run(Unknown Source)
    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class xyexs.snake.src.Reference
    	at xyexs.snake.src.Panel.paintComponent(Panel.java:16)
    	at javax.swing.JComponent.paint(Unknown Source)
    	at javax.swing.JComponent.paintToOffscreen(Unknown Source)
    	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
    	at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
    	at javax.swing.RepaintManager.paint(Unknown Source)
    	at javax.swing.JComponent._paintImmediately(Unknown Source)
    	at javax.swing.JComponent.paintImmediately(Unknown Source)
    	at javax.swing.RepaintManager$3.run(Unknown Source)
    	at javax.swing.RepaintManager$3.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.access$1000(Unknown Source)
    	at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)
    	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    	at java.awt.EventQueue.access$200(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    	at java.awt.EventQueue.dispatchEvent(Unknown Source)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.run(Unknown Source)
    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class xyexs.snake.src.Reference
    	at xyexs.snake.src.Panel.paintComponent(Panel.java:16)
    	at javax.swing.JComponent.paint(Unknown Source)
    	at javax.swing.JComponent.paintToOffscreen(Unknown Source)
    	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
    	at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
    	at javax.swing.RepaintManager.paint(Unknown Source)
    	at javax.swing.JComponent._paintImmediately(Unknown Source)
    	at javax.swing.JComponent.paintImmediately(Unknown Source)
    	at javax.swing.RepaintManager$3.run(Unknown Source)
    	at javax.swing.RepaintManager$3.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.access$1000(Unknown Source)
    	at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)
    	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    	at java.awt.EventQueue.access$200(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    	at java.awt.EventQueue.dispatchEvent(Unknown Source)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.run(Unknown Source)
    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class xyexs.snake.src.Reference
    	at xyexs.snake.src.Panel.paintComponent(Panel.java:16)
    	at javax.swing.JComponent.paint(Unknown Source)
    	at javax.swing.JComponent.paintToOffscreen(Unknown Source)
    	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
    	at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
    	at javax.swing.RepaintManager.paint(Unknown Source)
    	at javax.swing.JComponent._paintImmediately(Unknown Source)
    	at javax.swing.JComponent.paintImmediately(Unknown Source)
    	at javax.swing.RepaintManager$3.run(Unknown Source)
    	at javax.swing.RepaintManager$3.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.access$1000(Unknown Source)
    	at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)
    	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    	at java.awt.EventQueue.access$200(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    	at java.awt.EventQueue.dispatchEvent(Unknown Source)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.run(Unknown Source)
    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class xyexs.snake.src.Reference
    	at xyexs.snake.src.Panel.paintComponent(Panel.java:16)
    	at javax.swing.JComponent.paint(Unknown Source)
    	at javax.swing.JComponent.paintToOffscreen(Unknown Source)
    	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
    	at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
    	at javax.swing.RepaintManager.paint(Unknown Source)
    	at javax.swing.JComponent._paintImmediately(Unknown Source)
    	at javax.swing.JComponent.paintImmediately(Unknown Source)
    	at javax.swing.RepaintManager$3.run(Unknown Source)
    	at javax.swing.RepaintManager$3.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.prePaintDirtyRegions(Unknown Source)
    	at javax.swing.RepaintManager.access$1000(Unknown Source)
    	at javax.swing.RepaintManager$ProcessingRunnable.run(Unknown Source)
    	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    	at java.awt.EventQueue.access$200(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.awt.EventQueue$3.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    	at java.awt.EventQueue.dispatchEvent(Unknown Source)
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    	at java.awt.EventDispatchThread.run(Unknown Source)
    Help? :3
    Last edited by Xyexs; 08-30-2013 at 05:22 PM.

  2. #2
    Xyexs is offline Member
    Join Date
    Apr 2013
    Posts
    36
    Rep Power
    0

    Default Re: Renamed project and got loads of errors...

    Maybe itäs something in classpath ( that's what google tells me...)

  3. #3
    Xyexs is offline Member
    Join Date
    Apr 2013
    Posts
    36
    Rep Power
    0

    Default Re: Renamed project and got loads of errors...

    No answer? here's code

    Java Code:
    package xyexs.snake.src;
    
    import java.awt.BorderLayout;
    import java.awt.FlowLayout;
    import java.awt.Point;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.ArrayList;
    import java.util.Random;
    
    import javax.swing.ImageIcon;
    import javax.swing.JButton;
    import javax.swing.JDialog;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    
    public class Main {
    	// Variables
    	public static final int EASY_MOVE_TICK = 200;
    	public static final int MEDIUM_MOVE_TICK = 150;
    	public static final int HARD_MOVE_TICK = 100;
    	public static final int EXTREME_MOVE_TICK = 50;
    	public static int moveTick = MEDIUM_MOVE_TICK;
    	static int direction = 0;
    	static Panel panel = new Panel();
    	static Score scoreboard = new Score();
    	static int score = 0;
    	public static ArrayList<Point> snake = new ArrayList<Point>();
    	public static Point food = new Point();
    	static JFrame window = new JFrame(Reference.PROGRAM_NAME + " " + Reference.VERSION);
    	static Boolean doGrow = false;
    	static Boolean retry = false;
    	static Random rand = new Random();
    
    	// Main
    	public static void main(String[] args) {
    		do {
    			food.setLocation(Reference.PIXEL_SIZE * rand.nextInt(Reference.WINDOW_X / Reference.PIXEL_SIZE),
    					Reference.PIXEL_SIZE * rand.nextInt(Reference.WINDOW_Y / 50));
    		}
    		while (snake.contains(food));
    		
    		while (true) {
    			JLabel imageLabel = new JLabel();
    			imageLabel.setIcon(new ImageIcon(Main.class.getResource("/resources/Lost.png")));
    			imageLabel.setVisible(true);
    			score = 0;
    			direction = 0;
    			snake.removeAll(snake);
    			snake.add(new Point(500, 250));
    			snake.add(new Point(500, 300));
    			snake.add(new Point(500, 350));
    			window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    			window.setResizable(false);
    			window.add(panel, BorderLayout.CENTER);
    			window.add(scoreboard, BorderLayout.SOUTH);
    			window.setSize(Reference.WINDOW_X, Reference.WINDOW_Y);
    			window.pack();
    			window.setVisible(true);
    			final JDialog select = new JDialog(window, "Choose a difficulty", JDialog.DEFAULT_MODALITY_TYPE);
    			select.setLayout(new FlowLayout(FlowLayout.LEADING));
    			select.setSize(320, 70);
    			select.setResizable(false);
    			JButton easyButton = new JButton("Easy");
    			JButton mediumButton = new JButton("Medium");
    			JButton hardButton = new JButton("Hard");
    			JButton extremeButton = new JButton("Extreme");
    
    			easyButton.addActionListener(new ActionListener() {
    
    				public void actionPerformed(ActionEvent e) {
    					moveTick = EASY_MOVE_TICK;
    					select.dispose();
    				}
    			});
    
    			mediumButton.addActionListener(new ActionListener() {
    
    				public void actionPerformed(ActionEvent e) {
    					moveTick = MEDIUM_MOVE_TICK;
    					select.dispose();
    				}
    			});
    
    			hardButton.addActionListener(new ActionListener() {
    				public void actionPerformed(ActionEvent e) {
    					moveTick = HARD_MOVE_TICK;
    					select.dispose();
    				}
    			});
    
    			extremeButton.addActionListener(new ActionListener() {
    				public void actionPerformed(ActionEvent e) {
    					moveTick = EXTREME_MOVE_TICK;
    					select.dispose();
    				}
    			});
    
    			select.add(easyButton);
    			select.add(mediumButton);
    			select.add(hardButton);
    			select.add(extremeButton);
    			select.setVisible(true);
    
    			while (true) {
    				try {
    					Thread.sleep(moveTick);
    				}
    				catch (InterruptedException e) {
    					System.err.println("Sleep interrupted ( " + e + " )");
    				}
    
    				Point coord = snake.get(0);
    				Boolean isByTop = (coord.y == 0);
    				Boolean isByBot = (coord.y + Reference.PIXEL_SIZE == Reference.WINDOW_Y);
    				Boolean isByLeft = (coord.x == 0);
    				Boolean isByRight = (coord.x + Reference.PIXEL_SIZE == Reference.WINDOW_X);
    				Boolean facingSnake = false;
    				if (snake.lastIndexOf(snake.get(0)) > 0) {
    					facingSnake = true;
    				}
    				if (facingSnake == true) {
    					break;
    				}
    				if (isByTop == true && direction == 0) {
    					break;
    				}
    				else if (isByBot == true && direction == 2) {
    					break;
    				}
    				else if (isByRight == true && direction == 1) {
    					break;
    				}
    				else if (isByLeft == true && direction == 3) {
    					break;
    				}
    				else {
    					doGrow = false;
    					if (direction == 0) {
    						snake.add(0, new Point(coord.x, coord.y - Reference.PIXEL_SIZE));
    					}
    					else if (direction == 1) {
    						snake.add(0, new Point(coord.x + Reference.PIXEL_SIZE, coord.y));
    					}
    					else if (direction == 2) {
    						snake.add(0, new Point(coord.x, coord.y + Reference.PIXEL_SIZE));
    					}
    					else if (direction == 3) {
    						snake.add(0, new Point(coord.x - Reference.PIXEL_SIZE, coord.y));
    					}
    					if (snake.contains(food) == true) {
    						do {
    							food.setLocation(Reference.PIXEL_SIZE * rand.nextInt(Reference.WINDOW_X / Reference.PIXEL_SIZE),
    									Reference.PIXEL_SIZE * rand.nextInt(Reference.WINDOW_Y / 50));
    						}
    						while (snake.contains(food));
    						doGrow = true;
    					}
    					if (doGrow == false) {
    						snake.remove(snake.size() - 1);
    					}
    
    					panel.repaint();
    				}
    
    				
    				scoreboard.setText("Made by Xyexs        Length: " + snake.size());
    			}
    
    			window.remove(panel);
    			window.add(imageLabel, BorderLayout.CENTER);
    			window.pack();
    
    			final JDialog restart = new JDialog(window, "Retry?", JDialog.DEFAULT_MODALITY_TYPE);
    			JButton yes = new JButton("Sure!");
    			JButton no = new JButton("Nahh...");
    			restart.setLayout(new FlowLayout(FlowLayout.LEADING));
    			restart.setSize(165, 65);
    			restart.setResizable(false);
    
    			retry = false;
    			yes.addActionListener(new ActionListener() {
    				public void actionPerformed(ActionEvent e) {
    					retry = true;
    					restart.dispose();
    				}
    			});
    			no.addActionListener(new ActionListener() {
    				public void actionPerformed(ActionEvent e) {
    					restart.dispose();
    					retry = false;
    				}
    			});
    			restart.add(yes);
    			restart.add(no);
    			restart.setVisible(true);
    			if (retry == false) {
    				window.dispose();
    				break;
    			}
    		}
    	}
    
    	// Public Functions
    	public static int getDir() {
    		return direction;
    	}
    
    	public static void setDir(int dir) {
    		direction = dir;
    	}
    }
    
    
    //Panel class:
    
    
    
    package xyexs.snake.src;
    
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.Point;
    import java.awt.event.KeyAdapter;
    import java.awt.event.KeyEvent;
    import javax.swing.JPanel;
    
    @SuppressWarnings("serial")
    public class Panel extends JPanel {
    
    	public void paintComponent(Graphics g) {
    		super.paintComponents(g);
    		g.setColor(Reference.BACKGROUND_COLOR);
    		g.fillRect(0, 0, Reference.WINDOW_X, Reference.WINDOW_Y);
    		g.setColor(Reference.SNAKE_COLOR);
    		Point coord;
    		for(int i = 0 ; i <= Main.snake.size() - 1; i++){
    			coord = Main.snake.get(i);
    			g.fill3DRect(coord.x,coord.y, Reference.PIXEL_SIZE, Reference.PIXEL_SIZE,true);
    		}
    		g.setColor(Reference.FOOD_COLOR);
    		g.fill3DRect(Main.food.x, Main.food.y, Reference.PIXEL_SIZE, Reference.PIXEL_SIZE, true);
    		
    	}
    
    	public Panel() {
    		keyHandler handlerObject = new keyHandler();
    		setFocusable(true);
    		addKeyListener(handlerObject);
    	}
    
    	public Dimension getPreferredSize() {
    		return new Dimension(Reference.WINDOW_X, Reference.WINDOW_Y);
    	}
    
    	private class keyHandler extends KeyAdapter {
    		@Override
    		public void keyPressed(KeyEvent key) {
    			int keyCode = key.getKeyCode();
    			if ((keyCode >= 37 && keyCode <= 40) && (keyCode != ((keyCode - 37) + 2) % 4 + 37)) {
    
    				repaint();
    				if (keyCode == KeyEvent.VK_UP && Main.getDir() != 2) {
    					Main.setDir(0);
    				}
    				else if (keyCode == KeyEvent.VK_RIGHT && Main.getDir() != 3) {
    					Main.setDir(1);
    				}
    				else if (keyCode == KeyEvent.VK_DOWN && Main.getDir() != 0) {
    					Main.setDir(2);
    				}
    				else if (Main.getDir() != 1){
    					Main.setDir(3);
    				}
    			}
    		}
    	}
    }
    
    //Reference Class
    
    package xyexs.snake.src;
    
    import java.awt.Color;
    
    public class Reference {
    
    	public static final String PROGRAM_NAME = "Snake";
    	public static final String VERSION = "1.0";
    	public static final int MOVE_TICK = 50;
    	public static final int PIXEL_SIZE = 50;
    	public static final int SCORE_INCREMENT = 1;
    	public static final int WINDOW_X = 1000;
    	public static final int WINDOW_Y = 500;
    	public static final Color BACKGROUND_COLOR = new Color(100,100,100);
    	public static final Color SNAKE_COLOR = new Color(180,220,255);
    	public static final Color FOOD_COLOR = new Color(1800,220,255);
    }
    
    //Score class 
    
    
    package xyexs.snake.src;
    
    import java.awt.Dimension;
    import javax.swing.JLabel;
    
    @SuppressWarnings("serial")
    public class Score extends JLabel {
    
    	public Score() {
    		super("Score: 0");
    	}
    
    	public Dimension getPreferredSize() {
    		return new Dimension(Reference.WINDOW_X, 30);
    
    	}
    
    }

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,302
    Blog Entries
    7
    Rep Power
    20

    Default Re: Renamed project and got loads of errors...

    Have you read what the Exception was trying to tell you?

    Java Code:
    Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class xyexs.snake.src.Reference
        at xyexs.snake.src.Panel.paintComponent(Panel.java:16)
    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  5. #5
    Xyexs is offline Member
    Join Date
    Apr 2013
    Posts
    36
    Rep Power
    0

    Default Re: Renamed project and got loads of errors...

    That doesn't make sense to me ... Have i messed up at defining a class? No errors or warnings in IDE

  6. #6
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,302
    Blog Entries
    7
    Rep Power
    20

    Default Re: Renamed project and got loads of errors...

    Quote Originally Posted by Xyexs View Post
    That doesn't make sense to me ... Have i messed up at defining a class? No errors or warnings in IDE
    Well, that particular class can not be found; You, more than likely, copy the entire project to your new project; probably the compiler of your IDE can still find that class somewhere ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  7. #7
    Xyexs is offline Member
    Join Date
    Apr 2013
    Posts
    36
    Rep Power
    0

    Default Re: Renamed project and got loads of errors...

    Fixed :D
    Java Code:
        public static final Color FOOD_COLOR = new Color(1800,220,255);
    That should be incredibly red.. LAWL... :P

  8. #8
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,302
    Blog Entries
    7
    Rep Power
    20

    Default Re: Renamed project and got loads of errors...

    Quote Originally Posted by Xyexs View Post
    Fixed :D
    Java Code:
        public static final Color FOOD_COLOR = new Color(1800,220,255);
    That should be incredibly red.. LAWL... :P
    That should throw an IllegalArgumentException (see that API documentation for the Color class).

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  9. #9
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,580
    Rep Power
    5

    Default Re: Renamed project and got loads of errors...

    Quote Originally Posted by JosAH View Post
    That should throw an IllegalArgumentException (see that API documentation for the Color class).
    It probably does too, but the real exception is hidden in the fact that it triggers a static initializer error. The NoClassDefFoundError is a red herring.

    Yet another reason to not static everything in sight.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. Compile errors when adding a project to netbeans (help!)
    By Dreaming_Demon in forum New To Java
    Replies: 2
    Last Post: 01-19-2013, 01:22 PM
  2. Replies: 2
    Last Post: 01-31-2012, 11:32 AM
  3. Renamed my whole code.
    By roseownage in forum New To Java
    Replies: 7
    Last Post: 01-09-2012, 06:10 PM
  4. Netbeans IDE Errors while compiling a JSP project
    By pala in forum JavaServer Pages (JSP) and JSTL
    Replies: 5
    Last Post: 12-29-2011, 07:35 AM
  5. FileOutputStream Renamed Method
    By moomonkey in forum Advanced Java
    Replies: 2
    Last Post: 09-21-2011, 09:40 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •