Posts

Showing posts from December, 2008

Learning Swing with the NetBeans IDE

This is where the tutorial begins to get interesting, and for me it was the launch pad to my own first Java applet. I even like the form of the example. It not only contains the essential components of a GUI, but also a tiny bit of mathematics, and it performs a calculation which many of us perform in our head from time to time (if we come from an Anglo-Saxon culture with continental European influences). The lesson Setting up the Celsius Converter Project is important to read very slowly. Stuff this up and you stuff up your whole project. I think there might be a mistake in it. Certainly I made a mistake on my first run through, and it did stuff me right up. In Step 1: Create a New Project, the instructions are just fine. Step 2 is fine. Step 3 is also fine in so far as it goes. Obviously if you are using the lesson as a guide for your own custom project you will choose a name which suits you, but that is not the main issue. The main issue here is that nothi

Getting Started with Swing

Getting Started with Swing is the first lesson in the so-called Swing Tutorial . The lesson has two parts: About the JFC and Swing and Compiling and Running Swing Programs . The first is as dull as it sounds, albeit of theoretical importance. It is essentially a reminder of the transparency of Java - a reminder that the power of Java lies in the huge collection of classes, already written by someone else, but made available for everyone. So while you can use a development environment like NetBeans, you can also access the functionality of the classes with hand written code. This is important. If you want to program in VB (to create a Windows app) but you don't like the development environment, you are pretty well buggered. But if you want to create a GUI with Java, and you don't like NetBeans, you can either use another development environment, or you can do the whole thing with a text editor, provided you follow the rules very carefully. The second par

Swing

Since my last post I have been musing on the question of where to go next. Should I plough through more turgid lessons on the language or should I have some fun with the Swing thread. After some deliberation I have decided to go with A Brief Introduction to Swing . The first branch of this trail is a philosophical piece entitled What is Swing? It is best to ignore this as the tutorial tends to get muddled when it tries to be philosophical. The second branch, A Swing Demo , is much more fun. It talks you through a real applet, and it inspires enthusiasm because it is so neat, and it works so well. The Swing Features trail is pretty much a reference document with illustrations of what VB would call GUI objects, but which here are called Swing components. There is in my opinion rather too much space devotes to the so called "Look and Feel", and then there are the usual sections on internationalisation and accessibility, which in a politically correct world