Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException

when i click on the SUBMIT button ON,OFF window is visiable first OFF button is clicking I getting the error :

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at NextPage$2.actionPerformed(NextPage.java:36)

ON button is clicking the application is runing and click on OFF button the application terminated agin click on ON or OFF both are working

my problem is very first time click on OFF button that error came class NextPage extends JFrame { Image m; Thread t; NextPage(final String uname) {

................... ON.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ev) { m = new Image(uname); t = new Thread(m); t.setDaemon(true); t.start(); } });

    OFF.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent ev) {
            t.stop();
        }

});

}

}

class LoginDemo extends JFrame { ....... LoginDemo(){ ............ SUBMIT.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) {

            String value1 = text1.getText();
            String value2 = text2.getText();

try { .............. ................................ else if (value1.equals(uname) && enPassword.equals(pass)) { dispose(); new NextPage(uname); } } }

public class Image implements Runnable { public static void writeImage(BufferedImage img, String fileLocation, String extension) { ........... } public static String createTimeStampStr() throws Exception { ......... } public void randomImage(String uname) throws Exception { ............... while(true){ ........... } } }

View Answers









Related Tutorials/Questions & Answers:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException  ... is clicking I getting the error : Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at NextPage$2.actionPerformed(NextPage.java:36
Exception in thread
Exception in thread   Hi, In my code following error is coming: Exception in thread "main" java.lang.NoClassDefFoundError: org/json/JSONObject I have imported: import org.json.JSONObject; but its not working. What
Advertisements
Exception in thread
Exception in thread   Hi, In my code following error is coming: Exception in thread "main" java.lang.NoClassDefFoundError: org/json/JSONObject I have imported: import org.json.JSONObject; but its not working. What
Exception in thread
Exception in thread   Hi, I have created a java file for sending a file to my mail. I am using mail.jar file. I am able to create .class file...:\mail.jar SendMailTLSDFC Exception in thread "main" java.lang.NoClassDefFoundError
Exception in Thread
Exception in Thread    i am developing a rmi application in eclipse... client and generate connection with server i have following exception : Blockquote Exception in thread "RMI TCP Connection(idle
java.lang.NullPointerException
java.lang.NullPointerException  I am getting the bellow error message... the bellow error message java.lang.NullPointerException...] StandardWrapperValve[action]: Servlet.service() for servlet action threw exception
java.lang.NullPointerException
java.lang.NullPointerException  Hello! I would be very gratefull if you could find where is my problem and how can I fix it. (java.lang.NullPointerException) index.html: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01
Exception in thread "main" java.lang.ClassCastException
Exception in thread "main" java.lang.ClassCastException  I am trying to connect the database. I am stuck with this exception that is getting thrown...) { sqle.printStackTrace(); } finally { try {stmt.close();} catch (Exception e
Exception in thread "main" java.lang.ClassCastException
Exception in thread "main" java.lang.ClassCastException  I am trying to connect the database. I am stuck with this exception that is getting thrown...) { sqle.printStackTrace(); } finally { try {stmt.close();} catch (Exception e
exception in thread main java.lang.unsupportedclassversionerror in ubuntu
exception in thread main java.lang.unsupportedclassversionerror in ubuntu  Hi, In Ubuntu I am trying to run Java program and its throwing exception. exception in thread main java.lang.unsupportedclassversionerror in ubuntu How
exception in thread main java.lang.unsupportedclassversionerror in eclipse
exception in thread main java.lang.unsupportedclassversionerror in eclipse  Hi, I am trying to run a library which is from some other project. But it throws exception in thread main java.lang.unsupportedclassversionerror
exception in thread main while running servlet
exception in thread main while running servlet  I got exception in thread main no such method error while running servlet. I have added servlet.api.jar file in classpath.my classpath is C:\Program Files\Apache Software Foundation
Unhandled Exception in Thread
: Exception in thread "main" java.lang.NullPointerException...Unhandled Exception in thread are thrown during the execution of the program... to rectify it is to change it. Example of Unhandled exception in Thread: class
exception in thread main java.lang.unsupportedclassversionerror unsupported major.minor version 50.0 - Java Beginners
exception in thread main java.lang.unsupportedclassversionerror unsupported... getting the this error :exception in thread main...!"); } } for example: javac xxx.java-->comping java xxxx:error :exception in thread main
Java Exception Thread
Java Exception Thread     ... interface( java .lang. thread) Understand Exception in Threads. 1.A class name... is to be normal termination or caught exception.  5.runner = new Thread
exception in thread main java.lang.unsupportedclassversionerror unsupported major.minor version 50.0 - Java Beginners
exception in thread main java.lang.unsupportedclassversionerror unsupported major.minor version 50.0  I am getting the below error when the class now... is compling but runtime i am getting the exception in thread main
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/MailLogger
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/MailLogger  Hi, How to solve following error? Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/MailLogger
Java Runtime Exception: 0x4F4F:524A 0x4120:5445 0x4348:0D0A
some error-- Client side error: Exception in thread "AWT-EventQueue-0...Java Runtime Exception: 0x4F4F:524A 0x4120:5445 0x4348:0D0A   Sir I... server error INFO: Java Runtime Exception: 0x4F4F:524A 0x4120:5445 0x4348:0D0A
Exception in thread "main" org.hibernate.hql.ast.QuerySyntaxException: TESTING is not mapped [FROM TESTING]
Exception in thread "main" org.hibernate.hql.ast.QuerySyntaxException: TESTING...(HiberTest.java:18) Exception in thread "main...)); } } } couldn't connect to tDB using, SQL statements. Exception in thread "main
Thread
); } catch(Exception ex) { } } }; Thread thread3 = new Thread...(Exception ex) { } } }; Thread mainth = new Thread(main...Thread  Write a Java program to create three theads. Each thread
java.lang.NullPointerException - JSP-Servlet
java.lang.NullPointerException   ...(); rs1.close(); con.close(); } catch(Exception... java.lang.NullPointerException ..................... Pls help me ... my
Error java.lang.NullPointerException hibernate - Hibernate
Error java.lang.NullPointerException hibernate  hello everybody; I'm developping a web application using Struts 1.1 , Hibernate 3.1 and Mysql , and I've got this message error: Etat HTTP 500
thread
thread  can parent thread be dead if child thread is not dead
Thread
Thread  Thread Life Cycle
Thread
Thread  what is the use of thread
Thread
Thread  Explain two ways of creating thread in java. Explain at three methods of thread class.   Java Create Thread There are two main ways of creating a thread. The first is to extend the Thread class and the second
Thread
Thread  What is multi-threading? Explain different states of a thread... processor system. States of Thread: New state ? After the creations of Thread instance the thread is in this state but before the start() method invocation
Thread
to the thread constructor eventhough we had created only one thread and if you say we have added to point to the current thread then why we have not added this in the following line "s=s1" Pls reply...... class MyThread extends Thread { Thread
problem with org.apache.jasper.JasperException: java.lang.NullPointerException
problem with org.apache.jasper.JasperException: java.lang.NullPointerException  I could not find my mistake. Here is my code. Thanks in advance. <body> <% String pack_id = request.getParameter("pack_id
Thread
Thread  what happen when we call the Wait(),Notify() and NotifyAll() methods in the Thread
Thread
Thread  class Extender extends Thread { Extender(Runnable run...(); } public void run(){ System.out.println("Extender Thread is Started :"); //new Thread(new Implementer()).start(); } } class Implementer
exception
exception  wHEN RUNTIME EXCEPTION CLASS IS SUB OF EXCEPTION CLASS HOW CAN'T HANDLE UNCHECKED EXCEPTION
Thread
Thread  will this code work..? class A extends Thread { public...=" + i); } public static void main(string args[]) { A a = new A(); Thread t = new thread(a); t.start(); } } Is it possible to run above program with out
exception
exception  chek in and check out exception in java   Please visit the following link: Checked and Unchecked Exception
Thread
Thread   there are two threads running at a time.. when am updating a values in database. both thread halt and stop for moment till it get updated into database... so i dnt want thread to get halts for tht moment of period. whats
exception
arguments are not equalto two,throw a user defined exception "invalid parameter exception" ,otherwise display the two parameters.   Here is an example... is not equal to two then invalid parameter exception is thrown ,otherwise display the two
Thread
;Java throw and throws Whenever we want to force an exception then we use throw keyword. the throw keyword (note the singular form) is used to force an exception. It can also pass a custom message to your exception handling module. Moreover
exception
exception  what is the use of catch block even though we have predefined exception object
exception
exception  example for numberformat exception   Hi Friend, Try the following code:ADS_TO_REPLACE_1 class NumberFormatExceptionEx...); } catch(Exception e){ System.out.println(e
exception
defined checked exception ââ?¬Å?InvalidCharcterFoundExceptionââ?¬Â? and creater a block of codes that will handle the exception
Exception
Exception  whis is the Arithmetic Exception in java? or define Arithmetic Exception with exp?   Arithmetic Exception occurs, when you divide a number by zero. Example public class TryCatch { public static void main
Exception
Exception  what is NullPointerException?   Hi, I java NullPointerException java.lang.NullPointerException) is defined in the java.lang package.ADS_TO_REPLACE_1 The NullPointerException is thrown by the Java program
Exception
Exception  public class FooException extends Exception { public..."); } public void calculate() throws FooException, Exception { try { int.... ex.printStackTrace(); System.exit(1); } catch(Exception ex
Exception
Exception   I was creating a table dynamically but it shows exception i.e shown down Suplier created0 Suplier created0 Suplier created0 Product created0 Product created0 Product created0 Product created0 could not fetch initial
exception
user defined unchecked exception  can we create user defined unchecked exceptions? if so what is the exact use of it in real time?   Please visit the following links: http://www.roseindia.net/java/java-exception/user
exception
exception  Identify the reason for SQLException exception, which is encountered when the developer tries to run the following code snippet to insert..."); ps.executeUpdate(); } catch(Exception e
Java Basic - Applet
as: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException and also 10 to 12 lines of Errors get displayed as "Event Dispatch Thread". Please Reply
Java error java.lang.nullpointerexception
Java error java.lang.nullpointerexception  ...; is the exception that occurred when a programmer perform an operation on a object  or calling a method on the object i.e null. This exception is thrown
Java Sleep Thread
Java Thread sleep() is a static method. It sleeps the thread for the given time in milliseconds. It is used to delay the thread. It is used in Applet or GUI programming for animation Java Sleep Thread Example public class
Thread in java
Thread in java  which method will defined in thread class

Ads