Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Java Land F


Published on

  • Be the first to comment

  • Be the first to like this

Java Land F

  1. 1. Java Look-and-Feel Design Guidelines Eileen Kraemer University of Georgia CSCI 4800/600
  2. 2. An online book … <ul><li>The Java Look-and-Feel Design Guidelines, Second Edition are available online </li></ul><ul><li>Target audience: </li></ul><ul><ul><li>the designer who chooses the interface elements, lays them out in a set of components, and designs the user interaction model for an application </li></ul></ul>
  3. 3. Focus of the book …. <ul><li>design guidelines for software that uses the Swing classes together with the Java look and feel. </li></ul><ul><li>on creating cross-platform GUI (graphical user interface) applications and applets in the JavaTM programming language. </li></ul><ul><li>on design issues and human-computer interaction in the context of the Java look and feel. </li></ul><ul><li>guidelines are appropriate for GUI applications and applets on PCs and network computers; doesn’t address the problem of S/W that runs on consumer electronic devices. </li></ul>
  4. 4. What is the “Java Look and Feel”? <ul><li>First of all, what is a “look-and-feel”? </li></ul><ul><ul><li>The appearance and behavior of a complete set of GUI components. </li></ul></ul><ul><li>Why do we need a Java look-and-feel? </li></ul><ul><ul><li>Want to have Java applications that have a consistent look and behavior across multiple platforms </li></ul></ul><ul><ul><li>The goal of the Java look-and-feel is to provide a distinctive platform-independent appearance and standard behavior. </li></ul></ul>
  5. 5. Java look-and-feel <ul><li>Flush 3D style </li></ul><ul><ul><li>surfaces appear to be in the same plane as the surrounding canvas </li></ul></ul><ul><ul><li>border has a bevel </li></ul></ul><ul><li>Drag texture </li></ul><ul><li>Color model </li></ul>
  6. 7. Elements of the Java L&F <ul><li>Style of use/appearance of: </li></ul><ul><ul><li>Windows </li></ul></ul><ul><ul><li>Menus </li></ul></ul><ul><ul><li>Toolbars </li></ul></ul><ul><ul><li>editor panes </li></ul></ul><ul><ul><li>dialog boxes </li></ul></ul><ul><ul><li>alert boxes </li></ul></ul>
  7. 8. Java L&F Windows <ul><li>Platform-specific borders, title bar, and window controls </li></ul><ul><li>“Metal” look and feel window contents – menu bar, toolbar, editor pane, etc. </li></ul><ul><li>Here’s the code </li></ul>
  8. 9. Menus, the Menu Bar <ul><li>Provide access to and info about application’s primary functions </li></ul><ul><li>Later: guidelines for creation of such menus </li></ul>
  9. 10. Drop-down menus <ul><li>Menu separators divide choices into logical groupings </li></ul><ul><li>Titles highlighted in blue (default Java look and feel theme) </li></ul><ul><li>Can use keyboard shortcuts instead of the mouse. </li></ul><ul><li>Mnemonics – another way to access menu items.. </li></ul>
  10. 11. Keyboard shortcuts <ul><li>keystroke combinations that activate a menu item from the keyboard even if the menu for that command is not currently displayed. </li></ul><ul><li>usually consist of a modifier key and a character key, like Control-Z, plus a few special keys such as F1 and Delete. </li></ul><ul><li>Don’t post menus; rather, perform the indicated actions directly. </li></ul>
  11. 12. Mnemonic <ul><li>an underlined alphanumeric character in a menu title, menu item, or other interface component. </li></ul><ul><li>reminds the user how to activate the equivalent command by simultaneously pressing the Alt key and the character key that corresponds to the underlined letter or numeral. </li></ul><ul><li>See example code for both shortcuts and mnemonics </li></ul>
  12. 13. Guidelines for shortcuts … <ul><li>Specify keyboard shortcuts for frequently used menu items; don’t need a shortcut for every command </li></ul><ul><li>  Display shortcuts using the standard abbreviations for key names (such as Ctrl for the Control key), separated by hyphens. </li></ul><ul><li>Know the common shortcuts across platforms; use them. </li></ul><ul><li>  Don’t use the Meta key (the Command key on the Macintosh platform) for a shortcut, except as an alternate for Control. It isn’t available on some target platforms. </li></ul>
  13. 14. Java L&F Toolbar <ul><li>displays command and toggle buttons that offer immediate access to the functions of many menu items. </li></ul><ul><li>divided into functional areas </li></ul><ul><li>Flush 3D style </li></ul>
  14. 15. Java L&F Editor Pane <ul><li>Editor pane inside a scroll pane </li></ul>
  15. 16. Java L&F Dialog Boxes <ul><li>use the borders and title bars of the platform they are running on </li></ul><ul><li>dialog box contents have the Java look and feel </li></ul><ul><li>Windows, Mac, CDE </li></ul>
  16. 17. Java L&F Alert boxes <ul><li>Windows, Mac, CDE </li></ul>
  17. 18. Java Foundation Classes <ul><li>An extension to the original Abstract Window Toolkit ( AWT ), </li></ul><ul><li>Includes: </li></ul><ul><ul><li>the Swing classes , which define a complete set of GUI components for JFC applications </li></ul></ul><ul><ul><li>pluggable look and feel designs </li></ul></ul><ul><ul><li>the Java Accessibility API, </li></ul></ul><ul><li>all implemented without native code (code that refers to the functions of a specific operating system or is compiled for a specific processor). </li></ul><ul><li>components include: </li></ul><ul><ul><li>windows and frames, panels and panes, dialog boxes, menus and toolbars, buttons, sliders, combo boxes, text components, tables, list components, and trees. </li></ul></ul>
  18. 19. The Java 2 SDK <ul><li>contains the AWT, </li></ul><ul><ul><li>the class library that provides the standard application programming interfaces for building GUIs for Java programs. </li></ul></ul><ul><li>Contains a JFC that also includes </li></ul><ul><ul><li>the Java 2D API </li></ul></ul><ul><ul><li>drag and drop </li></ul></ul><ul><ul><li>other enhancements </li></ul></ul>
  19. 20. Support for Accessibility <ul><li>features of the Java 2 SDK that support people with special needs: </li></ul><ul><ul><li>the Java Accessibility API </li></ul></ul><ul><ul><ul><li>provides “hooks” for an assistive technology to interact and communicate with JFC components ( screen readers and screen magnifiers.) </li></ul></ul></ul><ul><ul><li>the Java Accessibility Utilities </li></ul></ul><ul><ul><ul><li>provides support in locating the objects that implement the Java Accessibility API. (These utilities are necessary for developers who develop only assistive technologies, not mainstream applications.) </li></ul></ul></ul><ul><ul><li>keyboard navigation, mnemonics, keyboard shortcuts (also called &quot;accelerators&quot;), customizable colors and fonts, and dynamic GUI layout. </li></ul></ul><ul><ul><li>A “pluggable” look and feel architecture that can be used to build both visual and nonvisual designs, such as audio and tactile UIs </li></ul></ul>
  20. 21. Accessibility, continued <ul><li>Keyboard navigation </li></ul><ul><ul><li>enables users to use the keyboard to move between components, open menus, highlight text, and so on. </li></ul></ul><ul><ul><li>makes an application accessible to people who find it difficult or impossible to use a mouse. </li></ul></ul>
  21. 22. Support for Internationalization <ul><li>J2SDK provides internationalized text handling and resource bundles. </li></ul><ul><ul><li>support for the bidirectional display of text lines </li></ul></ul><ul><li>J2SDK provides </li></ul><ul><ul><li>resource bundles </li></ul></ul><ul><ul><li>locale-sensitive sorting </li></ul></ul><ul><ul><li>support for localized numbers, dates, times, and messages. </li></ul></ul>
  22. 23. User Interface Components of the JFC <ul><li>Swing, a complete set of user interface components, including windows, dialog boxes, alert boxes, panels and panes, and basic controls. </li></ul><ul><li>Each JFC component contains </li></ul><ul><ul><li>a model (the data structure) </li></ul></ul><ul><ul><li>a user interface (the presentation and behavior of the component) </li></ul></ul>
  23. 25. Major JFC UI Components <ul><li>See table of components </li></ul>
  24. 26. Java L&F - Recommendations <ul><li>Don’t specify look and feel explicity. </li></ul><ul><ul><li>cross-platform l&f allows app to appear and perform the same everywhere </li></ul></ul><ul><ul><li>simplifies the app's development and doc </li></ul></ul><ul><ul><li>Java look and feel is used by default. </li></ul></ul><ul><ul><li>If error occurs while specifying name of any l&f, the Java l&f is used by default. </li></ul></ul><ul><li>Available Look and Feel Designs: </li></ul><ul><ul><li>Metal </li></ul></ul><ul><ul><li>Windows </li></ul></ul><ul><ul><li>CDE/Motif </li></ul></ul>