6 Replies - 489 Views - Last Post: 20 March 2013 - 08:33 PM Rate Topic: -----

#1 hwoarang69  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 171
  • Joined: 23-October 12

ExceptionInIntializerError

Posted 20 March 2013 - 06:51 PM

error detials

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_pages/game_pages/java_game_2/Background.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.doIntersectionPrivilege(Unknown Source)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(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.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)



can any one explain this error to me?


       /*** paint method ***/
	@Override
	public void paint(Graphics g) 
	{
		background_class.paint(g, this);  
		ground_class.paint(g);            
	
		player_class.paint(g);            
		for(int i = 0; i < platform_class.length; i++)
		{ platform_class[i].paint(g); }
		shoot_class.paint(g, player_class); 

				enemy_class.paint(g, enemy_class);
		
		for(int i = 0; i < item_class.length; i++)
		{ item_class[i].paint(g); }
		score_class.paint(g, this, pl



Is This A Good Question/Topic? 0
  • +

Replies To: ExceptionInIntializerError

#2 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8342
  • View blog
  • Posts: 31,880
  • Joined: 06-March 08

Re: ExceptionInIntializerError

Posted 20 March 2013 - 06:54 PM

t=what is at that line

at Main.paint(Main.java:204)
Was This Post Helpful? 0
  • +
  • -

#3 hwoarang69  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 171
  • Joined: 23-October 12

Re: ExceptionInIntializerError

Posted 20 March 2013 - 06:58 PM

i belive its
line204 on main.java:
 background_class.paint(g, this); 

This post has been edited by hwoarang69: 20 March 2013 - 06:58 PM

Was This Post Helpful? 0
  • +
  • -

#4 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8342
  • View blog
  • Posts: 31,880
  • Joined: 06-March 08

Re: ExceptionInIntializerError

Posted 20 March 2013 - 07:07 PM

so I beleive that background_class is null
Was This Post Helpful? 0
  • +
  • -

#5 hwoarang69  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 171
  • Joined: 23-October 12

Re: ExceptionInIntializerError

Posted 20 March 2013 - 07:17 PM

i printed the System.out.println(blackground_class) value before blackground_class.paint(g,this); and it outputs Background@1cd65428. does this mean its not null?
Was This Post Helpful? 0
  • +
  • -

#6 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8342
  • View blog
  • Posts: 31,880
  • Joined: 06-March 08

Re: ExceptionInIntializerError

Posted 20 March 2013 - 07:29 PM

Yes
So line 204 is not that line
Was This Post Helpful? 0
  • +
  • -

#7 hwoarang69  Icon User is offline

  • D.I.C Head

Reputation: -1
  • View blog
  • Posts: 171
  • Joined: 23-October 12

Re: ExceptionInIntializerError

Posted 20 March 2013 - 08:33 PM

i check again the 204 line is:
background_class.paint(g, this);


on eclipse i use print statment in paint method and they seem to have values. i dont know why error say its null

This post has been edited by hwoarang69: 20 March 2013 - 08:34 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1