Java Reference
In-Depth Information
Extending the GUI
In this chapter we will investigate how we can improve the GUI for Sketcher. After adding a status bar,
we will investigate how to create dialogs, and how we can use them to communicate with the user and
to manage input. Another GUI capability we will be exploring is pop-up menus, and we will be using
these to enhance the Sketcher application. All of this will give you a lot more practice in implementing
event listeners and more besides.
In this chapter you will learn:
How to create a status bar
How to create a dialog
What a modal dialog is and how it differs from a non-modal dialog
How to create a message box dialog
How you can use components in a dialog to receive input
What a pop-up menu is
What context menus are and how you can implement them
Creating a Status Bar
One limitation of the Sketcher program as it stands is that you have no direct feedback on what current
element type and color have been selected. As a gentle start to this chapter, let's fix that now. A window
status bar is a common and very convenient way of displaying the status of various application
parameters, each in its own pane.
Search WWH ::




Custom Search