aspose file tools*
The moose likes Applets and the fly likes Any JCalendar package users?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Any JCalendar package users??" Watch "Any JCalendar package users??" New topic
Author

Any JCalendar package users??

Dan Kim
Greenhorn

Joined: Dec 17, 2005
Posts: 16
Hi, my name is Dan and I'm a newb. I am using a JCalendar package from http://www.toedter.com/en/jcalendar/.

I created a simple applet where I am using the JDateChooser class. I compiled my applet and got no errors. But I get this error at execution time:
java.lang.NullPointerException
at javax.swing.ImageIcon.<init>(Unknown Source)
at com.toedter.calendar.JDateChooser.<init>(JDateChooser.java:172)
at com.toedter.calendar.JDateChooser.<init>(JDateChooser.java:111)
at CalendarApplet.init(CalendarApplet.java:19)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception in thread "thread applet-CalendarApplet.class" java.lang.NullPointerException
at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
at sun.plugin.AppletViewer.showAppletException(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Here's my simple applet code:


Funny thing is, if I go back to the applet code above and substitute JDateChooser with JCalendar, it works without problems. Any ideas why I'm having problems with JDateChooser? Thanks.

-Dan
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41806
    
  62
Hello Dan-

Welcome to JavaRanch.

I can only report that the applet works fine on OS X, so I can't guess why it might cause problems elsewhere. Maybe someone else can try it on Windows.


Ping & DNS - my free Android networking tools app
Dan Kim
Greenhorn

Joined: Dec 17, 2005
Posts: 16
Hello Ulf, thanks for the welcome.

Well...I compiled the applet using Java SDK 1.5.6 on WinXP machine. What's also weird is, I just created a regular Java application, not applet, again using JDateChooser class and it works fine with no problems. This is driving me nuts. For some reason, I can't use the JDateChooser class in an applet environment on my machine. I tried to download an earlier version of the JCalendar (1.1.4) package, but it doesn't have the JDateChooser class. I prefer to use the JDateChooser class since it is more compact, doesn't take as much space as the JCalendar class. I tried using both Firefox browser and IE, still no go on my machine. Oh well.

I e-mail Mr. Kai Toedter, hopefully he can help. I guess for the time being I can live with using the JCalendar class. Thanks again.

-Dan
Dan Kim
Greenhorn

Joined: Dec 17, 2005
Posts: 16
If anyone's interested, apparently the JDateChooser class does not work with JRE 1.5 update 6. Dunno about earlier updates. I uninstalled 1.5 and installed 1.4 update 10. My applet now works. I already sent Mr. Toedter an e-mail to inform him of this.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Any JCalendar package users??