Menus Bars and Menus
Menus in Java must be with the current release of the JDK created with code, since there is no portable resource format for Java, nor a drag-n-drop menu designer as in AppStudio, Delphi or any TCL/Tk GUI builder. There may never be a resource format for Java because of the inherited problems of endian-ness, device independence of icons, bitmaps, and availability of fonts. A menu bar is a graphical control element that contains drop-down menus. The menu bar’s purpose is to supply a common housing for window- or application-specific menus that provide access to such functions as opening files, interacting with an application, or displaying help documentation or manuals. The menu bar at the top of the screen provides a home for the top-level menus in your app. These menus can include standard, system-provided menus, as well as custom menus your app defines. The menu bar typically includes the following menus, in the following order.
- Apple menu
- App menu
- File menu
- Edit menu
- Format menu
- View menu
- App-specific menus
- Window menu
- Help menu
A dialog box is a user interface element, a type of window that is used to enable communication and interaction between a user and a software program. The dialog box appears when the program either needs to give the user information in an urgent manner that involves interruption, such as when an error occurs, or if the program requires immediate input or decision from the user, such as when the program closes and needs to know if the changes made have to be saved or not. The simplest form of the dialog box is an alert, which simply displays a message and only requires an acknowledgment from the user that the message has been read. For example, when you are using a program and you want to open a file, you interact with the “File Open” dialog box. In Microsoft Windows, when you right-click a file and choose Properties, you are presented with the Properties dialog box. Tip
You can press the Esc key to cancel or close a dialog box.
If the dialog box was created by an application, it is called a child window of the parent application.
File Dialog boxes
File Dialog Box is a box where it contains files. The OpenFileDialog component allows users to browse the folders of their computer or any computer on the network and select one or more files to open. The dialog box returns the path and name of the file the user selected in the dialog box. The FileName property can be set prior to showing the dialog box. This causes the dialog box to initially display the given filename. In most cases, your applications should set the InitialDirectory, Filter, and FilterIndex properties prior to calling ShowDialog.
File dialogs have been a subject of much usability debate. As a graphical control element receiving constant use, ease of use is a major factor in their design. The most common reasons for file dialog usability problems include:
- File system limitations,
- The wrong type of dialog for the application (e.g. no thumbnail view in a Wallpaper Selector, As in GNOME 2.6),
- Horizontal scrolling (As in Windows file dialogs),
- Uses non-standard terminology (Commonly in ports from other operating systems)
You may also like Understanding Layout managers