Well, after playing around a bit, I can reproduce the exception with an
Applet of about 1 "real" line of code. Somebody else HAS to have seen
this by now.
This applet creates a JButton and adds it to the applet window. That's
all. When run in the appletviewer, the button shows up fine. If you
RESIZE the appletviewer window, you get a NullPointerException.
Can somebody at SUN please verify this?? What can I be doing wrong with
only 1 line of code????
The exception does NOT occur with a regular AWT Button.
HELP!
-Lee
-----Original Message-----
From: J. Lee Dixon [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 13, 2000 9:32 AM
To: [EMAIL PROTECTED]
Subject: [JAVA2D] Exception when setting JButton icon at runtime
In my code, I construct a JButton using the empty constructor, then I
set the Icon for my JButton at runtime. I can run my code as an Applet
and as an application. When run as an application it works fine, but
when I run it as an applet in IE I get the following in my Java Console:
(I am running Java 1.3)
Exception occurred during event dispatching:
java.lang.NullPointerException
at
javax.swing.plaf.metal.MetalLookAndFeel.getControlDarkShadow(Unknown
Source)
at javax.swing.plaf.metal.MetalUtils.drawFlush3DBorder(Unknown
Source)
at javax.swing.plaf.metal.MetalUtils.drawButtonBorder(Unknown
Source)
at
javax.swing.plaf.metal.MetalBorders$ButtonBorder.paintBorder(Unknown
Source)
at javax.swing.border.CompoundBorder.paintBorder(Unknown Source)
at javax.swing.JComponent.paintBorder(Unknown Source)
at javax.swing.AbstractButton.paintBorder(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintWithBuffer(Unknown Source)
at javax.swing.JComponent._paintImmediately(Unknown Source)
at javax.swing.JComponent.paintImmediately(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown
Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
J. Lee Dixon
SAIC - Celebration, FL
407-566-1438
[EMAIL PROTECTED] AOL: LeeOrlando
========================================================================
===
To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
of the message "signoff JAVA2D-INTEREST". For general help, send email
to
[EMAIL PROTECTED] and include in the body of the message "help".
Title: Applet title
First Heading
Test1.class
Test1.java