User Interface Programming
1999; Linguagem: Inglês
10.1007/978-1-4471-0843-6_18
ISSN1439-9245
Autores Tópico(s)Usability and User Interface Design
ResumoIn 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 facility. 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. Of course life is not quite as simple as this; you need to take into account how the various components in the window should be laid out, what the window should do in response to an event (such as a user clicking a button) and how to terminate the window cleanly. In the last chapter, you briefly saw part of this when the WindowListener interface was used to catch the windowClosing event.
Referência(s)