Main Page

Previous Next


In this chapter you have learned how to use dialogs to manage data input. You have also learned how to implement context menus, which can bring a professional feel to the GUI in your applications. You have applied scrollbars to varying data values as well as scrolling a window, so you should be in a position to use them in whatever context you need.

The important points we have covered in this chapter are:

  • A modal dialog blocks input from other windows in the same application as long as it is displayed.

  • A non-modal dialog does not block input to other windows. You can switch the focus between a non-modal dialog and other windows in the application whenever necessary.

  • The JOptionPane class provides static methods for creating simple dialogs.

  • A pop-up menu is a menu that can be displayed at any point within the coordinate system of a component.

  • A context menu is a pop-up menu that is specific to what lies at the point where the menu is displayed – so the contents of the menu depend on the context.

  • A context menu is displayed as a result of a pop-up trigger, which is usually a right mouse button click.

  • The AffineTransform class defines an affine transformation that can be applied to a graphics context and to a Shape object.

  • A Graphic2D object always contains an AffineTransform object, and the default transform leaves coordinates unchanged.

  • The transform for a graphics context is applied immediately before user coordinates for a shape are converted to device coordinates.

  • There are four kinds of transform you can create: translations, rotations, scaling, and shearing.

  • You can combine any number of transformations in a single AffineTransform object.

Previous Next
JavaScript Editor Java Tutorials Free JavaScript Editor