i printed the value in paint method in frond middle and end. still no null.
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
i printed the value in paint method in frond middle and end. still no null.
That's good that you are not getting the exception any more. Strange that it only happened once.
If you don't understand my answer, don't ignore it, ask a question.
i still getting the same error on web. but when i use eclipse there is no error or no null.
I don't understand what you are doing???
To find the problem, you need to execute the code that has the problem, not some other version.
Keep adding println() statements to show the variables used on each line until you see the variable that is null.
Copy and post the whole contents showing the print outs and the exception error message
If you don't understand my answer, don't ignore it, ask a question.
i dont know what u saying here. i am execute the code that has the problem which is my Main.java. on line 204. and i am keep adding println() statment but they have some value in it. i dont understand why its give me error on web. i am test on web bc its an applet. that why i said in ecipse it works fine no error. but when i run it web, i get a error.To find the problem, you need to execute the code that has the problem, not some other version.
again the error was :
error: ExceptionInInitializerError
more detail:
Java Plug-in 10.17.2.02
Using JRE version 1.7.0_17-b02 Java HotSpot(TM) Client VM
User home directory = C:\Users\dave
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------
CacheEntry[http://localhost/E_COMMERCE/menu_pag...ground.class]: updateAvailable=true,lastModified=Wed Mar 20 20:14:30 EDT 2013,length=1492
Exception in thread "AWT-EventQueue-2" java.lang.NullPointerException
at Main.paint(Main.java:204)
at sun.awt.RepaintArea.paintComponent(Unknown Source)
at sun.awt.RepaintArea.paint(Unknown Source)
at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(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.doIntersectionPri vilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPri vilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPri vilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilter s(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Where is the line that your println() prints out BEFORE the statement with the error?
If you don't understand my answer, don't ignore it, ask a question.
i cant print it before the error. i dont think u understand that i am saying.
again there are no error in eciples. in eciples the applet works and run fine.
problem is when i try to load the applet in web by using <applet> tag.
on web i get a error. take a look at image. error.jpg
You need to find what variable has the null value. A way to do that is to print out the values of the variables in the statement where the error occurs and see which one has the null value. Executing the code in the IDE does not cause the error so its a waste of time executing the code there. Execute it where the error happens.
Images aren't any good. You need to copy the program's output that is shown in the java console and paste it here.
I'm done for tonight. Back tomorrow.
If you don't understand my answer, don't ignore it, ask a question.