« Java - Client side applet applications as well as server side | Main | Tktable - Laying out data in a matrix - Tcl/Tk »
August 30, 2007
GUI design - Sketch it out first! (Java / Swing example)
"A picture paints a thousand words" ... and so it is when you're planning a graphic user interface, and implementing it. Yesterday, I picked up an old example of a dialer written in Java - you can see the actual window it generates on the right - and was looking to work out how it hung together.
A JFrame called Dialer has a Container called cp contains two Swing Jpanels called upper and lower, which are layed out with gridLayouts. Upper contains 3 components - Jlabels, one of which has no name and the other is called Result, and a JButton called OK,
The lower JPanel contains a further 12 JButtons, each of which has a temporary name of current assigned to it as its being defined ....
I did say that "A picture paints a Thousand words", didn't I? All this is shown in the diagram to the left. If you would like to see the source code, its available in full here
Posted by gje at August 30, 2007 04:36 PM