Why was that program so ugly?

You did not decide to learn java so you could write strings to the console like some 1960's science fiction drama. Where are the web based graphics and GUI windows and menus you have come to expect?

From the very first release Java came with a standard set of libraries for creating graphical applications that have an appearance similar to modern GUI style programs that you would expect in an environment like the Macintosh or MS Windows.

This is a significant contrast to older programming languages where the "out of the box" experience was the text interface with various non standardised libraries available for creating graphical applications. Delightful though it is to create windows, buttons and components the things that make the programs actually go can be developed and tested in a purely text environment. It is also useful to keep the graphical interface and the "back end" functionality separate.

But to fast forward from an era of kipper ties and excess facial hair we need to get a demonstration of a better looking program than the text version of HelloWorld. The simplest way to demonstrate a graphical Java application is to create a simple Frame and then add a button to it.

Last modified: Sunday, 20 September 2015, 07:21 PM