This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Exception in thread Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at javax.swing.border.BevelBo" Watch "Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at javax.swing.border.BevelBo" New topic
Author

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at javax.swing.border.BevelBo

Pranit Sonawane
Ranch Hand

Joined: Jul 29, 2011
Posts: 155

Hi all am getting this exceptional error

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at javax.swing.border.BevelBorder.<init>(BevelBorder.java:78)
at javax.swing.border.SoftBevelBorder.<init>(SoftBevelBorder.java:71)
at Pack1.WlcmScr.initComponents(WlcmScr.java:54)
at Pack1.WlcmScr.<init>(WlcmScr.java:17)
at Pack1.WlcmScr$1.run(WlcmScr.java:192)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705)
at java.awt.EventQueue.access$000(EventQueue.java:101)
at java.awt.EventQueue$3.run(EventQueue.java:666)
at java.awt.EventQueue$3.run(EventQueue.java:664)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:675)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)


and my code goes like this



please suggest what can I do?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Look at line 34 of your code:

You are passing null for the third argument of the constructor of SoftBevelBorder. That's not allowed. Pass a Color instead of null.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at javax.swing.border.BevelBo
 
Similar Threads
Symbol Not Found - What am I Missing?
Problem With GUI of Net Beans
Storing JTextField to variable
Networked Programs that work across countries
Pressing a button to open a new window