Java Development
I recently came across a listing of qualifications for a software engineer
position dealing with writing internet apps, mainly in Java. I like this one:
"Experience developing Java GUI applications and applets for cross-platform
deployment. If you've run into
cross-platform quirks and incompatibilities in the AWT,
you're probably a good candidate for the position."
I think that's me!
Think of the hours spent tweaking applets so that they will run on _all_
web browsers, ouch! Here are some fun examples:
My favorite Java Quirks:
- If you are doing cross-platform development, I cannot stress enough
how important it is to test or develop your applets on a machine that
does NOT use pre-emptive multi-threading. Not only are the java
implementations different across web-browsers, they are different across
platform-specific web browsers, something one might forget... for example,
an applet that works fine under Win95 fails to function under UNIX because
two lines of code are in the wrong order. Who knew.
- The class loader on some browsers won't load classes that aren't
declared public even though those classes were compiled in the same package
as the classes instantiating them. (ouch!)
This results in nasty exceptions being thrown.
- Which background color? Lets say we decide not to specifically paint a
section of a panel. What color is it painted when we repaint? IE 3.0 seems
to set it to the specified background color of the applet. Netscape seems to set it to
the specified background color of the browser ... This results in nasty strips of colors
you'ld rather not see on your applet, and if you don't use the right browser,
you'ld never get to see it. (actually, the AWT tells you it will default to
some color, but the different browser implementations still confuse me)
- If I compile a .java file which is in package x, and in subdirectory x,
and then try to compile a .java file also in package x, which uses the
previously compiled class, and is in subdirector x, the compiler does NOT find that class unless it is compiled on the same command line. (This is the part where you tear your hair out of your head)
- If I specify a new classpath on the command line, the default classpath is not added, but overwritten. If my JDK uses some classes.zip file to get the default packages, how can I specify that zip file as a directory?
- Unix GUI implementations replace button colors with specified background applet colors. But they don't replace choicemenu colors. Windows won't replace ANY of those colors... but Windows still has the better looking UI components.
- Applet width and height are specified in pixels, but each platform uses it's own GUI components, which are some platform dependent arbitrary size. Therefore, one applet size configuration might appear correctly under one platform, but appear too wide or narrow or too tall or short for the given layout, because of those arbitrary sizes. The same problem occurs with font size, which are specified in points, but are returned by the platform as some arbitrary pixel size... I hope you like working dynamically with font metrics.
- more as I find them....