Java Look and Feel Design Guidelines
Total Page:16
File Type:pdf, Size:1020Kb
User interface guidelines for designers of applications TM based on the JAVA JavaTM Foundation Classes LOOK AND FEEL DESIGN GUIDELINES JAVA™ LOOK AND FEEL DESIGN GUIDELINES Please send your email feedback to us at [email protected] JAVA™ LOOK AND FEEL DESIGN GUIDELINES Sun Microsystems, Inc. Addison-Wesley An imprint of Addison Wesley Longman, Inc. Reading, Massachusetts • Harlow, England • Menlo Park, California Berkeley, California • Don Mills, Ontario • Sydney • Bonn Amsterdam • Tokyo • Mexico City Copyright 1999 Sun Microsystems, Inc., 901 San Antonio Road, Copyright 1999 Sun Microsystems, Inc., 901 San Antonio Road, Palo Alto, California 94303 U.S.A. All rights reserved. Palo Alto, Californie 94303 Etats-Unis. Tous droits réservés. This product or documentation is protected by copyright and Ce produit ou document est protégé par un copyright et distribué distributed under licenses restricting its use, copying, avec des licences qui en restreignent l’utilisation, la copie, la distribution, and decompilation. No part of this product or distribution, et la décompilation. Aucune partie de ce produit ou documentation may be reproduced in any form by any means document ne peut être reproduite sous aucune forme, par without prior written authorization of Sun and its licensors, if any. quelque moyen que ce soit, sans l’autorisation préalable et écrite Third-party software, including font technology, is copyrighted de Sun et de ses bailleurs de licence, s’il y en a. Le logiciel détenu and licensed from Sun suppliers. par des tiers, et qui comprend la technologie relative aux polices de caractères, est protégé par un copyright et licencié par des Sun, Sun Microsystems, the Sun logo, Java, JavaHelp, Java 2D, fournisseurs de Sun. HotJava, JavaBeans, JDK, the Java Coffee Cup logo, Solaris, and Write Once, Run Anywhere are trademarks or registered Sun, Sun Microsystems, le logo Sun, Java, JavaHelp, Java 2D, trademarks of Sun Microsystems, Inc. in the U.S. and other HotJava, JavaBeans, JDK, Java Coffee Cup logo, Solaris, et Write countries. Netscape Navigator is a trademark or registered Once, Run Anywhere sont des marques de fabrique ou des trademark of Netscape Communications Corporation. UNIX is a marques déposées de Sun Microsystems, Inc. aux Etats-Unis et registered trademark in the United States and other countries, dans d’autres pays. Netscape Navigator est une marque de exclusively licensed through X/Open Company, Ltd. Adobe is a Netscape Communications Corporation. UNIX est une marque registered trademark of Adobe Systems, Incorporated. enregistree aux Etats-Unis et dans d’autres pays et licenciée exclusivement par X/Open Company, Ltd. Adobe est une marque The OPEN LOOK and Sun™ Graphical User Interface was developed enregistree de Adobe Systems, Incorporated. by Sun Microsystems, Inc. for its users and licensees. Sun acknowledges the pioneering efforts of Xerox in researching and L’interface d’utilisation graphique OPEN LOOK et Sun™ a été developing the concept of visual or graphical user interfaces for développée par Sun Microsystems, Inc. pour ses utilisateurs et the computer industry. Sun holds a non-exclusive license from licenciés. Sun reconnaît les efforts de pionniers de Xerox pour la Xerox to the Xerox Graphical User Interface, which license also recherche et le développement du concept des interfaces covers Sun’s licensees who implement OPEN LOOK GUIs and d’utilisation visuelle ou graphique pour l’industrie de otherwise comply with Sun’s written license agreements. l’informatique. Sun détient une licence non exclusive de Xerox sur l’interface d’utilisation graphique Xerox, cette licence couvrant U.S. Government approval required when exporting the product. également les licenciés de Sun qui mettent en place l’interface DOCUMENTATION IS PROVIDED “AS IS” WITHOUT WARRANTY OF d’utilisation graphique OPEN LOOK et qui en outre se conforment ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT aux licences écrites de Sun. L’accord du gouvernement américain LIMITED TO, ANY KIND OF IMPLIED OR EXPRESS WARRANTY OF est requis avant l’exportation du produit. NON-INFRINGEMENT OR THE IMPLIED WARRANTIES OF LA DOCUMENTATION EST FOURNIE “EN L’ETAT” ET TOUTES AUTRES MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. CONDITIONS, DÉCLARATIONS ET GARANTIES EXPRESSES OU TACITES SONT FORMELLEMENT EXCLUES DANS LA MESURE AUTORISÉE PAR LA LOI APPLICABLE, Y COMPRIS NOTAMMENT TOUTE GARANTIE IMPLICITE RELATIVE À LA QUALITÉ MARCHANDE, À L’APTITUDE À UNE UTILISATION PARTICULÈRE OU À L’ABSENCE DE CONTREFAÇON. The publisher offers discounts on this book when ordered in quantity for special sales. For more information, please contact: Corporate & Professional Publishing Group Addison-Wesley Publishing Company One Jacob Way Reading, Massachusetts 01867 Text printed on recycled and acid-free paper ISBN 0-201-61585-1 Please 1 2 3 4 5 6 7 8 9-MA-99989796 Recycle First Printing, June 1999 CONTENTS Preface xix Part I: Overview 1 Chapter 1: The Java Look and Feel 3 Fundamentals of the Java Look and Feel 3 Visual Tour of the Java Look and Feel 4 MetalEdit Application 5 Retirement Savings Calculator Applet 10 Chapter 2: The Java Foundation Classes 15 Java Development Kit 15 Java Foundation Classes 15 JDK 1.1 and the Java 2 SDK 16 Support for Accessibility 16 Support for Internationalization 17 User Interface Components of the Java Foundation Classes 17 Pluggable Look and Feel Architecture 17 Example Model and Interface 18 Client Properties 18 Major JFC User Interface Components 19 Look and Feel Options 23 Java Look and Feel—the Recommended Design 23 Alternative Approaches 23 Supplied Designs 24 Part II: Fundamental Java Application Design 25 Chapter 3: Design Considerations 27 Choosing an Application or an Applet 27 Distribution 28 Security Issues 28 Placement of Applets 29 Designing for Accessibility 30 Benefits of Accessibility 30 Contents vi Accessible Design 30 Planning for Internationalization and Localization 33 Benefits of Global Planning 34 Global Design 34 Chapter 4: Visual Design 39 Themes 39 Colors 40 Fonts 45 Capitalization of Text in the Interface 46 Headline Capitalization in English 46 Sentence Capitalization in English 47 Layout and Visual Alignment 47 Between-Component Padding and Spacing Guidelines 48 Design Grids 49 Titled Borders for Panels 51 Text Layout 52 Animation 54 Progress and Delay Indication 54 System Status Animation 55 Chapter 5: Application Graphics 57 Working With Cross-Platform Color 57 Working With Available Colors 58 Choosing Graphic File Formats 58 Choosing Colors 59 Maximizing Color Quality 60 Designing Graphics in the Java Look and Feel Style 62 Designing Icons 63 Working With Icon Styles 63 Drawing Icons 64 Designing Button Graphics 66 Using Button Graphic Styles 67 Producing the Flush 3D Effect 67 Working With Button Borders 68 Determining the Primary Drawing Area 68 Drawing the Button Graphic 69 Designing Symbols 72 Designing Graphics for Corporate and Product Identity 73 Designing Installation Screens 73 Contents vii Designing Splash Screens 73 Designing Login Splash Screens 75 Designing About Boxes 76 Chapter 6: Behavior 77 Mouse Operations 77 Pointer Feedback 78 Mouse-over Feedback 79 Clicking and Selecting Objects 80 Displaying Contextual Menus 80 Drag-and-Drop Operations 81 Typical Drag and Drop 81 Pointer and Destination Feedback 82 Keyboard Operations 82 Keyboard Focus 83 Keyboard Navigation and Activation 85 Keyboard Shortcuts 87 Mnemonics 88 Part III: The Components of the Java Foundation Classes 91 Chapter 7: Windows, Panes, and Frames 93 Anatomy of a Primary Window 95 Constructing Windows 97 Primary Windows 97 Secondary Windows 98 Plain Windows 99 Utility Windows 100 Organizing Windows 101 Panels 101 Scroll Panes 102 Tabbed Panes 104 Split Panes 106 Working With Multiple Document Interfaces 108 Internal Frames 108 Palettes 110 Chapter 8: Dialog Boxes 111 Modal and Modeless Dialog Boxes 112 Dialog Box Design 112 Tab Traversal Order 114 Contents viii Spacing in Dialog Boxes 115 Command Buttons in Dialog Boxes 115 Default Command Buttons 118 Common Dialog Boxes 120 Find Dialog Boxes 120 Login Dialog Boxes 120 Preferences Dialog Boxes 120 Print Dialog Boxes 121 Progress Dialog Boxes 121 Alert Boxes 122 Info Alert Boxes 123 Warning Alert Boxes 124 Error Alert Boxes 124 Question Alert Boxes 125 Color Choosers 126 Chapter 9: Menus and Toolbars 129 Menu Elements 130 Menu Bars 130 Drop-down Menus 131 Submenus 132 Menu Items 132 Checkbox Menu Items 135 Radio Button Menu Items 135 Separators 136 Common Menus 136 Typical File Menu 137 Object Menu 137 Typical Edit Menu 138 Typical Format Menu 138 View Menu 139 Typical Help Menu 139 Contextual Menus 139 Toolbars 140 Toolbar Placement 141 Draggable Toolbars 141 Toolbar Buttons 142 Tool Tips 145 Contents ix Chapter 10: Basic Controls 147 Command Buttons 148 Default Command Buttons 149 Combining Graphics With Text in Command Buttons 150 Using Ellipses in Command Buttons 150 Command Button Spacing 151 Command Button Padding 151 Toggle Buttons 152 Independent Choice 152 Exclusive Choice 153 Checkboxes 154 Checkbox Spacing 154 Radio Buttons 155 Radio Button Spacing 156 Combo Boxes 156 Noneditable Combo Boxes 157 Editable Combo Boxes 158 Sliders 159 Progress Bars 160 Chapter 11: Text Components 163 Labels 164 Labels That Identify Controls 164 Labels That Communicate Status and Other Information 166 Text Fields 167 Noneditable Text Fields 167 Editable Text Fields 167 Password Fields 168 Text Areas 169 Editor Panes 170 Default Editor Kit 170 Styled Text Editor Kit 170