06. maj 2007 - 18:22Der er
12 kommentarer og 1 løsning
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerExcep
//Code//
/* * Bike.java * * Created on 6. maj 2007, 16:21 * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ import java.awt.*; import java.awt.event.*;
import javax.swing.*; /** * * @author Joshlo */ public class Bike extends javax.swing.JFrame {
private JFrame frame; private JPanel gearpanel; private JPanel speedpanel; private JPanel pulsepanel; private Graphics g; private int x1; private int x2; private int y1; private int y2; private int y3;
/** Creates a new instance of Bike */ public Bike() { createFrame(); }
public void createFrame() { g.setColor(Color.GRAY);
public static void main(String []args) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Bike(); } }); } }
//fejl//
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at Bike.createFrame(Bike.java:37) at Bike.<init>(Bike.java:32) at Bike$1.run(Bike.java:96) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209) at java.awt.EventQueue.dispatchEvent(EventQueue.java:461) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149) at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.