why I hate java lib

It takes so many lines of cruft to load a simple image.

import java.awt.*

Image image = Toolkit.getDefaultToolkit().getImage(args[0]);
MediaTracker mediaTracker = new MediaTracker(new Container());
mediaTracker.addImage(image, 0);

…. when it could be as simple as

Image image = SomeClass.getImage(args[0])

I think, it's not a language problem. It is just the obsession with object oriented-ness!

Add a New Comment