User Interface Programming
In the last chapter you saw how to create a window and place a panel on it that allows you to draw graphic objects (lines, rectangles etc.). However, today’s graphical user interfaces (GUIs) go far beyond this, allowing buttons, input and output fields, selection lists, menus etc. The Abstract Window Toolkit (AWT) provides many classes which directly support these types of facilities. As Java is a pure object-oriented language, a button is an object, a menu is an object, a text field is an object and so is a selection list. Thus to create a GUI in Java, you create the window and instances of the facilities you require; then you add these instances to the window instance. You use the Frame and Panel classes, just as you did in the previous chapter, to display such GUI component objects.
Unable to display preview. Download preview PDF.