Java GUI Layout: WTF?

      • As I sit and play with a new IDE I don’t know how to use yet, I am dropping controls onto a form and noticing that I can’t ever get it to lok the way I’d want, and I am wondering, why-n-th-ell did they think that the Java way of doing GUI layouts was better than anything else? This N-S-E-W panel business stinks, me thinks. I can’t get anything to look “right”. Seems to me that a system of using X/Y coordinates (for up-left/low-right corners) that use numbers which are a percentage of the screen dimensions makes *way[/i more sense. It sems a lot more obvious (you could put stuff directly right where you wanted it), and no more complicated, if not less. Why does Java use the layout methods that it does?

Because, while the language itself was quite cleanly crafted by competant programers, the GUI interface was apparently handed off to associate orangutans who wouldn’t know a useful user interface from a .38 special with a rusted-over safety. Or maybe I’m just in a bad mood this morning.

There is a wealth of literature on good user interfaces going back decades, almost as much as the amount on what makes a good computer language. They apparently studied up on the latter at the expense of the former.

You are a victim, for the most part, of an historical accident. The first Java AWT (Abstract Windowing Toolkit) had a very limited number of layout managers, of which BorderLayout (the one you’re complaining about) was unfortunately the easiest to use for semi-complicated displays. The user community complained loudly and any programmer worth their salt built (or borrowed) their own layout manager(s). Unfortunately many “programmers” didn’t or couldn’t follow suit and used what was available. GUI management software seemed (seems) to be the worst offender. No one wants a custom layout manager in their “standard” GUI builder.

According to somebody from Sun in a quote I read the other day but can’t find right now, the layout managers are intended to be used in combination with each other to produce the desired effects. This is possible but IMO your still better off writing your own or using one of the many layouts that are available from user’s groups or Gamelan or somesuch.

[Other comments having to do with eating quiche deleted by poster’s better judgement.]