[java] Portability of the Icon

Started by
7 comments, last by cyrax256 21 years, 11 months ago
Hi, I''ve finally done my Uno game I''ve told you in this forum. Because my PC is Windows and I use Solaris at work, I brought my game and tried to run it but appears this exception: Failed to open /resources/UNOHelp.htm Exception in thread "main" java.lang.NullPointerException at sun.awt.motif.MFramePeer.setIconImage(MFramePeer.java:93) at java.awt.Frame.setIconImage(Frame.java:416) at UNOWindow.inictComponents(UNOWindow.java:106) at UNOWindow.(UNOWindow.java:23) at UNOMain.main(UNOMain.java:4) My game has basically two frames, the UNOWindow which has the game, and the UNOHelpScreen, which obviously display a help screen (the help file is in HTML, and it displays it, nothing too fancy). Both these frames load an Icon in the title bar, something that Windows usually does and it has no problem. But in Solaris the title bar does not have a nice icon in the close button, and I think it''s because this the error mentioned above appears. Well, I''d like to know who has found this error and tell me how fixed it. El Ciro
Ciro Durán :: My site :: gamedev.net :: AGS Forums
Advertisement
What version of Java did you use to develop/test this? What version is one your work machine? (Also keep in mind that if you're using MS J++ it adds some non-standard features which are not supported by true Java [Thats why Sun successfully sued them to stop making it])

[EDIT]: This is just a preliminary guess, I haven't personally look into motif.MFramePeer.setIconImage before.

[edited by - michalson on May 6, 2002 10:01:07 AM]
I think that''s the reason. But now I need to recreate the error to tell you good, because I commented the setIconImage lines and everything went allright. :-P

I didn''t know that Sun sued MS for their actions :-P It''s time to tell Microsoft not to insert their own incompatible stuff just to take over a technology :-)
Ciro Durán :: My site :: gamedev.net :: AGS Forums
Sounds like you attempted to pass a null image to the setIconImage method. Probably the image was not understood by the solaris did you use .ico or .gif? .ico''s may be readable under windows but .gif will work under both.

BTW, I use the 100% original SDK from Sun, not other stuff from other companies....
Ciro Durán :: My site :: gamedev.net :: AGS Forums
I use in my work the jre 1.3.1_02, but this one is in Linux

In Solaris the 1.2.2 version is installed

El Ciro
Ciro Durán :: My site :: gamedev.net :: AGS Forums
Probably both of those things. 1.3 likely introduces the functionality to load from your filetype, hence 1.2 returns a null pointer (you could insert some error checking to ensure the method returns a valid pointer before using it)
quote:Original post by snowmoon
Sounds like you attempted to pass a null image to the setIconImage method. Probably the image was not understood by the solaris did you use .ico or .gif? .ico''s may be readable under windows but .gif will work under both.



All the images I use are in PNG format (it''s the best things invented since canned jam :-) )

El Ciro
Ciro Durán :: My site :: gamedev.net :: AGS Forums
BTW, the Uno game is finished :-) (finally, after a Hard Disk format that deleted more than a half of my work :-P), fi you want to check it, download it at http://www.ldc.usb.ve/~ciro/uno/uno.jar (1.8Mb)

Quite simple, download it, if you have Windows just double click it (provided you have installed the Java Runtime Environment 1.3.1 or later), or if you have any UNIX, run the console and type in the directory you downloaded the file: java -jar uno.jar

If Windows downloads you the file as uno.jar.zip, rename it to uno.jar
Ciro Durán :: My site :: gamedev.net :: AGS Forums

This topic is closed to new replies.

Advertisement