Java Reference
In-Depth Information
Tip If you have a question about how to design an action that is intuitive for the end user, the answer is
sometimes very easy to find: Look for another popular program with similar functionality. Designing an inter-
face that is similar to other application interfaces to which the user may be accustomed is a helpful way to
ensure your application is intuitive as well.
Figure 8-4. An applied path
Also, placing a button next to a text field suggests that the button performs some type
of action associated with the text field. This principle dictates a significant design error you
should be cautious of committing. Because the user interprets grouped items as grouped
functionally, placing a Quit button directly next to a Save button is a very bad idea. The Quit
item is considered a destructive action because it terminates program execution, whereas the
Save button is a nondestructive and frequently used action. This particular interface design
error could result in users quitting the program when they really intended to save their work.
It is important to always remember that the average user is accident-prone. Developers
must assume that users will make mistakes and click a wrong button every now and then. A
good interface design with proper button groupings and placements will minimize this possi-
bility. In many real-world applications, the user interface might even go a step further and
implement an “undo” mechanism using the facilities available in the javax.swing.undo pack-
age. This enhanced functionality allows the user to revert the application state to a preceding
point in time and erase the ramification of an action that may have been a mistake. Although
this functionality is useful, it is far beyond what is required for the SCJD exam.
Another consideration to keep in mind when designing a user interface is that you as the
developer may have assumptions about an application's operating environment, but these
assumptions can never be considered fact. For example, just because your development com-
puter has a mouse attached to it does not mean you can assume that every computer your
application runs on will have a mouse. This is especially true for Java applications because
they aim to target almost every platform in existence. To ensure the functionality of your user
interface, each functional widget on the screen should have a keystroke mnemonic mapping,
Search WWH ::




Custom Search