aspose file tools*
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
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: 165

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: 14347
    
  22

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 8 API documentation
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at javax.swing.border.BevelBo