John Zukowski's Definitive Guide to Swing for Java 2
|
|
- Lorena Underwood
- 5 years ago
- Views:
Transcription
1 John Zukowski's Definitive Guide to Swing for Java 2 JOHN ZUKOWSKI APress Media, LLC
2 John Zukowski's Definitive Guide to Swing for Java 2 Copyright ~1999 by John Zukowski Originally published by Apress in 1999 Ali rights reserved. No part of this work may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval system, without the prior written permission of the copyright owner and the publisher. Library of Congress Cataloging-in-Publication Data Zukowski, John. [Definitive Swing Guide] John Zukowski's Definitive Swing Guide 1 John Zukowski. p. cm. 1. Java (Computer program language) I. Title. QA76.73.J38Z8493 OOS.13'3-dc Swing (Computer file) Additional material to this book can be downloaded from ISBN ISBN (ebook) DOI / CIP Trademarked names may appear in this book. Rather than use a trademark symbol with every occurrence of a.trademarked name, we use the names only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. Project Manager: Nancy DelFavero Project Editor: Carol Lombardi Technical Reviewers: Gary Cornell, Randy Kahle, Blake Ragsdell, Tim Rohaly, and Laurence Vanhelsuwe Copyeditor: Mark Woodworth Proofreaders: Valerie Cover and Christine Sabooni Production Assistance: Lori Ash Indexer: Nancy Humphreys In the United States, phone SPRINGER; orders@springer-ny.com; Cover and Interior Design: Derek Yee Design For information on translations, please contact APress directly: APress, 6400 Hollis Street, Suite 9, Emeryville, CA Phone: 510/ ; Fax: 510/ ; info@apress.com; The information in this book is distributed on an ''As Is" hasis, without warranty. Although every precaution has been taken in the preparation of this work, neither the author nor APress shal1 have any liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this work. ii
3 Author's Acknowledgments WORKING WITH APRESS ON THIS BOOK has been fim. 1 would like to personally thank everyone who helped along the way, both in the formation of a new technical publisher and for the help in converting my rough manuscript into the material you have in your hands today. At APress, 1 would first like to thank Gary Cornell, Bill Pollock, and Dan Appleman for allowing me to work with them at such an early stage of company development. Now that we have Dan Appleman's book and my book, we can work at filling some spaces between the N.s and Z's. 1 would especially like to thank Nancy DelFavero and Carole Lombardi for their help in shaping what you're reading. Special thanks to the technical editors, Laurence Vanhelsuwe, Blake Ragsdell, Gary Cornell, Tim Rohaly, and Randy Kahle, who helped to ensure the technical accuracy of the content. Any remaining technical inaccuracies are my fault alone. On the graphics side, thanks to Derek Yee Design for helping to convert my rough sketches, mostly in Visio, to the quality illustrations you see in this book. For some of the images used in the example programs, 1 would like to thank Dean Jones for the JavaLobby Foundation Applications -Icon Collection ( /webart.javalobby.org/jlicons/) and Deb Felts at the Image Addict's Attic ( (There is a reason why 1 am nota graphic artist.) They retain the copyrights on their respective images, and the images are used with permission. For their ideas and assistance during development, 1 would like to thank Joe Sam Shirah, Wong Kok Wai, Tomoko Iwama, Carlos Lucasius and the Licensee Support team in Ontario, the Swing! Team, and everyone at MageLang Institute. This book is that much better because of them. As always, 1 am grateful to my wife, Lisa, for her never-ending patience during the development of this book and aur playful pup, Jaeger, who helps keep me sane (sometimes). Thanks to Mom and Dad, too, even though they don't remember getting me thatvic 20. iii
4 About the Author JOHN ZUKOWSKI IS A WELL-KNOWN FIGURE in the Java community. He is a popular columnist for ]ava World magazine and a member of the ]ava World Senior Advisory Board. Zukowski provides significant content for Sun's Java Developer Connection and is the guide for Java at About.com. In addition, he is a faculty member of the MageLang Institute, an instructor-led training firm that is the leading provider of advanced Java training to the computer industry. He is also the author of]avaawt Reference (O'Reilly), Mastering]ava 2 (Sybex), and Borland's ]Builder: No Experience Required (Sybex). iv
5 Contents Introduction... 1 Development Versions... 2 How This Book Is Structured... 2 Reading the UML Diagrams... 4 Support... 5 Chapter 1 Swing Overview...? AWT Component Replacements... 8 New Components Event Handling and Layout Management Undo Framework Using Swing Classes with JDK SwingSet Demonstration JComponent to Page Mapping Summary Chapter 2 Event Handling with the Swing Component Set Delegation-Based Event Handling Using Event Listeners as Observers A Quick Look at the JFrame Class Creating an ExitableJFrame Class Using SwingUtilities for Mouse Button Identification Using Property Change Listeners as Observers Managing Listener Lists Swing-Specific Event Handling Interface Action Class AbstractAction Class KeyStroke Using Mnemonics and Accelerators V
6 Swing Focus Management Examining Focus Cycles Customizing Component-Level Focus Management Setting the Next Focusable Component Class FocusManager and DefaultFocusManager WritingYour Own Focus Manager Multithreaded Swing Event Handling Using SwingUtilities for Thread Safety Class Timer Summary Chapter 3 The Model-View-Controller Architecture MVC Communications Sharing Data Models Understanding the Predefined Data Models Summary Chapter 4 Core Swing Components Class JComponent Component Pieces JComponent Properties Handling JComponent Events Class JTool Tip Creating a JToolTip Creating Customized JToolTip Objects Displaying Positional ToolTip Text Customizing JToolTip Look and Feei Class ToolTipManager ToolTipManager Properties Class JLabe Creating a JLabel JLabel Properties Handling JLabel Events Customizing JLabel Look and Feel vi
7 Interface Icon Creating an lcon Using an Icon Class Imagelcon Class GrayFilter Class AbstractButton AbstractButton Properties HandlingAbstractButton Events Listening to AbstractButton Events with a PropertyChangeListener Class Button Creating a JButton JButton Properties Handling JButton Events Listening to JButton Events with an ActionListener Customizing a JButton Look and Feel Class JPane Creating a JPanel Using a JPanel Customizing JPanel Look and Feel Summary Chapter 5 Toggle Buttons Class ToggleButtonModel Class ButtonGroup... 12B Class JToggleButton Creating JToggleButton Components JToggleButton Properties Handling JToggleButton Selection Events Customizing a JToggleButton Look and Feel Class JCheckBox Creating JCheckBox Components JCheckBox Properties Handling JCheckBox Selection Events Customizing a JCheckBox Look and Feel Class JRadioButton Creating JRadioButton Components JRadioButton Properties Grouping JRadioButton Components in a ButtonGroup Handling JRadioButton Selection Events Customizing a JRadioButton Look and Feel Summary vii
8 Chapter 6 Swing Menus and Toolbars Working with Menus Getting Started Menu Class Hierarchy Class JMenuBar SingleSelectionModel Interface Class JMenultem Class JMenu Class JSeparator Class JPopupMenu Class JCheckBoxMenultem Class JRadioButtonMenultem Creating Custom MenuElement Components Working with Toolbars: Class JToolBar Creating ]ToolBar Components Adding Components to a JToolBar ]ToolBar Properties Handling ]ToolBar Events Customizing JToolBar Look and Feei A Complete JToolBar Usage Example JToolBar.Separator Summary Chapter 7 Borders Some Bas ies on Working with Borders Exploring the Border lnterface Introducing BorderFactory Starting with AbstractBorder Examining the Predefined Borders Creat ing Your Own Borders Summary Chapter 8 Root Pa ne Containers Class JRootPane Creating a JRootPane JRootPane Properties Interface RootPaneContainer Class JLayeredPane viii
9 Class JFrame Creating a JFrame JFrame Properties Adding Components to a JFrame Handling JFrame Events Extending JFrame Class JWindow Creating a JWindow JWindow Properties Handling JWindow Events Extending JWindow Class JDialog Creating a }Dialog }Dialog Properties Handling }Dialog Events Extending }Dialog Class JApplet Testing JApplet Solutions Extending JApplet Working with a Desktop Class JinternalFrame Class JDesktopPane Summary Chapter 9 Pop-Ups and Choosers Class JOptionPane Creating a JOptionPane Displaying a JOptionPane Automatically Creating a JOptionPane in a Pop-up Window JOptionPane Properties Customizing JOptionPane Look and Feel Class ProgressMonitor Creating a ProgressMonitor Using a ProgressMonitor ProgressMonitor Properties Customizing ProgressMonitor Look and Feel Complete ProgressMonitor Example Class ProgressMonitorinputStream Creating a ProgressMonitorlnputStream Using a ProgressMonitorlnputStream ProgressMonitorlnputStream Properties ix
10 Class JColorChooser Creating a JColorChooser Using JColorChooser Listening for Color Selection Changes Creating and Showing a JColorChooser Pop-up Window ProvidingYour Own OK/Cancel Event Listeners JColorChooser Properties Customizing a JColorChooser Look and Feel Class JFileChooser Creating a JFileChooser Using JFileChooser Adding an ActionListener to a JFileChooser Creating and Showing a JFileChooser within a Pop-up Window JFileChooser Properties Customizing JFileChooser Look and Feel Summary Chapter 1.0 Swing Layout Managers Class BoxLayout Creating a BoxLayout Laying Out Components Class OverlayLayout Class SizeRequirements Class ScrollPaneLayout Class ViewportLayout Summary Chapter 1.1. Advanced Swing Containers Class Box Creating a Box Box Properties Working with Box.Filler Creating Areas That Grow Creating Rigid Areas Class JSplitPane Creating a JSplitPane JSplitPane Properties Listening for JSplitPane Property Changes Customizing a JSplitPane Look and Feei X
11 Class JTabbedPane Creating a JTabbedPane Adding and RemovingTabs JTabbedPane Properties Listening for Changing Tab Selection Customizing a JTabbedPane Look and Feel Class JScrollPane Cre ating a JScrollPane Changing the Viewport View Interface Scrollable JScrollPane Properties Customizing a JScrollPane Look and Feel Class JViewport Creating a Niewport Niewport Properties Scrolling the View Customizing a Niewport Look and Feel Summary Chapter 1.2 Bounded Range Components Interface BoundedRangeModel Class Defaul tboundedrangemodel Class JScrollBar Creating JScrollBar Components Handling Scrolling Events JScrollBar Properties Customizing a JScrollBar Look and Feel Class JSlider Creating JSlider Components Handling JSlider Events JSlider Properties Customizing a JSlider Look and Feel JSlider Client Properties Class JProgressBar Cre ating JProgressBar Components JProgressBar Properties Handling JProgressBar Events Customizing a JProgressBar Look and Feel Class JTextField and Interface BoundedRangeModel Summary xi
12 Chapter 1.3 List Model Controls Interface ListModel Class AbstractUstModel Class DefaultListModel Ustening for UstModel Events with a UstDataUstener Interface ComboBoxModel Interface MutableComboBoxModel Class DefaultComboBoxModel Class JList Creating JUst Components JUst Properties Scrolling JList Components Rendering JList Elements Selecting JUst Elements Customizing JUst Look and Feel DualListBox Example Class JComboBox Creating JComboBox Components JComboBox Properties Rendering JComboBox Elements Selecting JComboBox Elements Editing JComboBox Elements Customizing a JComboBox Look and Feel Shared Data Model Example Summary Chapter 1.4 Basic Text Components Class JTextComponent JTextComponent Properties JTextComponent Operations Class JTextField Creating a JTextField Using JLabel Mnemonics JTextField Properties JTextComponent Operations with a JTextField Document Interface Interface DocumentUstener/Interface DocumentEvent Interface Caret and Interface Highlighter Interface CaretUstener 1 Class CaretEvent Interface Keymap Class JTextComponent.KeyBinding xii
13 Handling JTextField Events Customizing a JTextField Look and Feel Class JPasswordField Creating a JPasswordField JPasswordField Properties Customizing JPasswordField Look and Fee Class JTextArea Creating a JTextArea JTextArea Properties Handling JTextArea Events Customizing a JTextArea Look and Feel Class JEditorPane Creating a JEditorPane JEditorPane Properties Handling JEditorPane Events Interface HyperlinkListener 1 Class HyperlinkEvent Customizing a JEditorPane Look and Feel Class JTextPane Creating a JTextPane JTextPane Properties Customizing a JTextPane Look and Feel Sample JTextPane Summary Chapter 15 Advanced Text Capabilities Class TextAction Listing Actions Using Actions Finding Actions Creating Styled Text Interface StyledDocument/ Class DefaultStyledDocument Interface AttributeSet Interface MutableAttributeSet Class SimpleAttributeSet Class StyleConstants Class TabStop and TabSet Interface Style Class StyleContext The Editor Kits Working with Views Summary xiii
14 Chapter 16 Sculpting Trees Introducing Trees Class JTree Cre ating a JTree Scrolling Trees JTree Properties Customizing a JTree Look and Feel Interface TreeCellRenderer Class DefaultTreeCellRenderer DefaultTreeCellRenderer Properties Cre ating a Custom Renderer Working with Tree Tooltips Editing Tree Nodes Interface CellEditor Interface TreeCellEditor Class DefaultCellEditor Class DefaultTreeCellEditor Creating a Proper ComboBox Editor for a Tree Creating an Editor Just for LeafNodes lnterface CellEditorListener/Class ChangeEvent Creating a Better Check Box Node Editor Working with the Nodes of the Tree lnterface TreeNode lnterface MutableTreeNode Class DefaultMutableTreeNode Traversing Trees Class JTree.DynamicUtilTreeNode DraggingTree Nodes Interface TreeModel Class DefaultTreeModel Interface TreeModelListener/Class TreeModelEvent Interface TreeSelectionModel Class DefaultTreeSelectionModel Interface TreeSelectionListener 1 Class TreeSelectionEvent Class TreePath Additional Expansion Events lnterface TreeExpansionListener /Class TreeExpansionEvent Interface TreeWillExpandListener/Class ExpandVetoException Summary xiv
15 Chapter 11 Tables Introducing Tables Class JTable Creating a JTable Scrolling JTable Components Manually Positioning the JTable View Removing Column Headers JTable Properties Rendering Table Cells Handling JTable Events Customizing a JTable Look and Feel Interface TableModel Class AbstractTableModel Class DefaultTableModel Sorting JTable Elements Interface TableColumnModel Class DefaultTableColumnModel Listening to JTable Events with a TableColumnModelListener Class TableColumn Class JTableHeader Cre ating a JTableHeader JTableHeader Properties Using Tooltips Customizing a JTableHeader Look and Feel Editing Table Cells Interface TableCellEditor 1 Class DefaultCellEditor Creating a Simple Cell Editor Creating a Complex Cell Editor Summary Chapter 18 Understanding the Pluggable Look and Feel Architecture Class LookAndFeel Listing the Installed Look and Feel Classes Changing the Current Look and Feel Customizing the Current Look and Feel Creating a New Look and Feel Using the MacLookAndFeel on a Non-Macintosh Adding UI Delegates XV
16 Working with Metal Themes Class MetalTheme DefaultMetalTheme Using an Auxiliary Look and Feel Summary Chapter 19 Becoming Undone Working with the Undo Framework Using the Undo Framework with Swing Text Components The Command Design Pattern Interface UndoableEdit Class AbstractUndoableEdit Class CompoundEdit Class UndoManager A Complete Undoable Program Example Using the StateEditable Interface and StateEdit Class Summary Appendix A UI Manager Properties Appendix 8 About the CD-ROM Loading the CD contents What"s on the CD? Some Tips on Using the CD For the Java 2 platform For the Java 1.1 platform Places to Go for More Informat ion If You Have Any CD Problems xvi
Introduction p. 1 JFC Architecture p. 5 Introduction to JFC p. 7 The JFC 1.2 Extension p. 8 Swing p. 9 Drag and Drop p. 16 Accessibility p.
Introduction p. 1 JFC Architecture p. 5 Introduction to JFC p. 7 The JFC 1.2 Extension p. 8 Swing p. 9 Drag and Drop p. 16 Accessibility p. 17 MVC Architecture p. 19 The MVC Architecture p. 20 Combined
More informationSwing. By Iqtidar Ali
Swing By Iqtidar Ali Background of Swing We have been looking at AWT (Abstract Window ToolKit) components up till now. Programmers were not comfortable when doing programming with AWT. Bcoz AWT is limited
More informationSwing UI. Powered by Pentalog. by Vlad Costel Ungureanu for Learn Stuff
Swing UI by Vlad Costel Ungureanu for Learn Stuff User Interface Command Line Graphical User Interface (GUI) Tactile User Interface (TUI) Multimedia (voice) Intelligent (gesture recognition) 2 Making the
More informationChapter 12 GUI Basics
Chapter 12 GUI Basics 1 Creating GUI Objects // Create a button with text OK JButton jbtok = new JButton("OK"); // Create a label with text "Enter your name: " JLabel jlblname = new JLabel("Enter your
More informationJava IDE Programming-I
Java IDE Programming-I Graphical User Interface : is an interface that uses pictures and other graphic entities along with text, to interact with user. User can interact with GUI using mouse click/ or
More informationHandout 14 Graphical User Interface (GUI) with Swing, Event Handling
Handout 12 CS603 Object-Oriented Programming Fall 15 Page 1 of 12 Handout 14 Graphical User Interface (GUI) with Swing, Event Handling The Swing library (javax.swing.*) Contains classes that implement
More informationRizvi College of Arts, Science & Commerce Bandra (W), Mumbai Teaching Plan Academic Year
Academic Year 17-18 Subject: ADVANCE JAVA Class : T.Y.B.Sc. (IT) DIV: Faculty: ARIF PATEL Months JUNE JULY AUGUST Topics to be covered Understanding Layout Manager. Swing: JColorChooser, JComboBox, JFileChooser,
More informationCS410G: GUI Programming. The Model/View/Controller Pattern. Model. Controller. View. MVC is a popular architecture for building GUIs
CS410G: GUI Programming The Model/View/Controller design pattern provides a clean distinction between the your application s data (model), your GUI (view), and the how they interact (controller). Many
More informationJava 11 Swing with Eclipse Index
One Introduction to Java 1 Usage of Java 2 Structure of Java 4 Flexibility of Java Programming 5 Swing and AWT in Java 7 Using Eclipse 9 Two Dialog Boxes 10 Using Dialog Boxes 11 Using Message Dialogs
More informationJava 11 Swing Index. Section Title Page
One Introduction to Java 2 Usage of Java 3 Structure of Java 4 Flexibility of Java Programming 5 Swing and AWT in Java 6 Two Using Java in DOS 9 Using the DOS window 10 DOS Operating System Commands 11
More informationJava 1.9 Swing Index
One Introduction to Java 2 Usage of Java 3 Structure of Java 4 Flexibility of Java Programming 5 Swing and AWT in Java 6 Two Using Java in DOS 9 Using the DOS window 10 DOS Operating System Commands 11
More informationJTcl and Swank. Bruce A. Johnson, Tom Poindexter, & Dan Bodoh. What s new with Tcl and Tk on the JVM. Wednesday, October 26, 11
JTcl and Swank What s new with Tcl and Tk on the JVM Bruce A. Johnson, Tom Poindexter, & Dan Bodoh JTcl and Swank Bruce s Motivation Cross-platform, scriptable, desktop applications for analyzing and visualizing
More informationSwing. Component overview. Java UI, summer semester 2017/2018 1
Swing Component overview 1 Label class JLabel for displaying short text image both 2 Buttons many kinds of buttons all of them extends AbstractButton regular button (JButton) "click" button toggle button
More informationChapter 13 GUI Basics. Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved.
Chapter 13 GUI Basics 1 Motivations The design of the API for Java GUI programming is an excellent example of how the object-oriented principle is applied. In the chapters that follow, you will learn the
More informationContents Introduction 1
SELF-STUDY iii Introduction 1 Course Purpose... 1 Course Goals...1 Exercises... 2 Scenario-Based Learning... 3 Multimedia Overview... 3 Assessment... 3 Hardware and Software Requirements... 4 Chapter 1
More informationJava 1.8 Swing with Eclipse Oxygen Index
One Introduction to Java 1 Usage of Java 2 Structure of Java 4 Flexibility of Java Programming 5 Using the Eclipse software 6 Swing and AWT in Java 7 Two Running Java in Eclipse 10 Introduction 11 Using
More informationJava 1.8 Swing with Eclipse Mars Index
One Introduction to Java 1 Usage of Java 2 Structure of Java 4 Flexibility of Java Programming 5 Using the Eclipse software 6 Swing and AWT in Java 7 Two Running Java in Eclipse 10 Introduction 11 Using
More informationJava 1.8 Swing with Eclipse Neon Index
One Introduction to Java 1 Usage of Java 2 Structure of Java 4 Flexibility of Java Programming 5 Using the Eclipse software 6 Swing and AWT in Java 7 Two Running Java in Eclipse 10 Introduction 11 Using
More informationChapter 12 GUI Basics. Motivations. The design of the API for Java GUI programming
Chapter 12 GUI Basics 1 Motivations The design of the API for Java GUI programming is an excellent example of how the object-orientedoriented principle is applied. In the chapters that follow, you will
More informationGraphical User Interface (GUI) components in Java Applets. With Abstract Window Toolkit (AWT) we can build an applet that has the basic GUI
CBOP3203 Graphical User Interface (GUI) components in Java Applets. With Abstract Window Toolkit (AWT) we can build an applet that has the basic GUI components like button, text input, scroll bar and others.
More informationCSE 1325 Project Description
CSE 1325 Summer 2016 Object-Oriented and Event-driven Programming (Using Java) Instructor: Soumyava Das Graphical User Interface (GUI), Event Listeners and Handlers Project IV Assigned On: 07/28/2016 Due
More informationTool Kits, Swing. Overview. SMD158 Interactive Systems Spring Tool Kits in the Abstract. An overview of Swing/AWT
INSTITUTIONEN FÖR Tool Kits, Swing SMD158 Interactive Systems Spring 2005 Jan-28-05 2002-2005 by David A. Carr 1 L Overview Tool kits in the abstract An overview of Swing/AWT Jan-28-05 2002-2005 by David
More informationJBuilder 8.0 JFC and Swing Programming
TEAMFLY JBuilder 8.0 JFC and Swing Programming Chuck Easttom Wordware Publishing, Inc. Library of Congress Cataloging-in-Publication Data Easttom, Chuck. JBuilder 8.0 JFC and Swing programming / by Chuck
More informationCSE 143. Event-driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT
CSE 143 Event-driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT slides created by Marty Stepp based on materials by M. Ernst, S. Reges, D. Notkin, R. Mercer, Wikipedia http://www.cs.washington.edu/331/
More informationChapter 6: Graphical User Interfaces
Chapter 6: Graphical User Interfaces CS 121 Department of Computer Science College of Engineering Boise State University April 21, 2015 Chapter 6: Graphical User Interfaces CS 121 1 / 36 Chapter 6 Topics
More informationIs image everything?
Is image everything? Review Computer Graphics technology enables GUIs and computer gaming. GUI's are a fundamental enabling computer technology. Without a GUI there would not be any, or much less: Computer
More informationCS111: PROGRAMMING LANGUAGE II
CS111: PROGRAMMING LANGUAGE II Computer Science Department Lecture 10(b): Working with Controls Agenda 2 Case study: TextFields and Labels Combo Boxes buttons List manipulation Radio buttons and checkboxes
More informationPublisher : O'Reilly Pub Date : November 2002 ISBN : Pages : 1278
1 Table of Contents &"87%" class="t2" height="17">index &"87%" class="t2" height="17">reviews Examples Reader Reviews Errata Java Swing, 2nd Edition By Brian Cole, Robert Eckstein, James Elliott, Marc
More informationSummary Chapter 25 GUI Components: Part 2
1040 Chapter 25 GUI Components: Part 2 ponent on the line. TheJTextField is added to the content pane with a call to our utility method addcomponent (declared at lines 79 83). MethodaddComponent takes
More informationLecture 18 Java Graphics and GUIs
CSE 331 Software Design and Implementation The plan Today: introduction to Java graphics and Swing/AWT libraries Then: event-driven programming and user interaction Lecture 18 Java Graphics and GUIs None
More informationJava Graphical User Interfaces
Java Graphical User Interfaces 1 The Abstract Windowing Toolkit (AWT) Since Java was first released, its user interface facilities have been a significant weakness The Abstract Windowing Toolkit (AWT)
More informationIntroduction to the JAVA UI classes Advanced HCI IAT351
Introduction to the JAVA UI classes Advanced HCI IAT351 Week 3 Lecture 1 17.09.2012 Lyn Bartram lyn@sfu.ca About JFC and Swing JFC Java TM Foundation Classes Encompass a group of features for constructing
More informationJava: Graphical User Interfaces (GUI)
Chair of Software Engineering Carlo A. Furia, Marco Piccioni, and Bertrand Meyer Java: Graphical User Interfaces (GUI) With material from Christoph Angerer The essence of the Java Graphics API Application
More informationSupporting Materials
Preface p. xxiii Introduction p. xxiii Key Features p. xxiii Chapter Outlines p. xxiv Supporting Materials p. xxvi Acknowledgments p. xxvii Java Fundamentals p. 1 Bits, Bytes, and Java p. 2 The Challenge
More informationLearn Java Programming, Dr.Hashamdar. Getting Started with GUI Programming
Learn Java Programming, Dr.Hashamdar Getting Started with GUI Programming 1 Creating GUI Objects // Create a button with text OK JButton jbtok = new JButton("OK"); // Create a label with text "Enter your
More informationA Programmer's Guide to
J2EE FrontEnd Technologies: A Programmer's Guide to Servlets, JavaServer Pages, and Enterprise JavaBeans LENNART JGRELID APress Media, LLC J2EE FrontEnd Technologies: A Programmer's Guide to Servlets,
More informationCSE 331 Software Design & Implementation
CSE 331 Software Design & Implementation Hal Perkins Winter 2018 Java Graphics and GUIs 1 The plan Today: introduction to Java graphics and Swing/AWT libraries Then: event-driven programming and user interaction
More informationuser-friendly and easy to use.
Java Graphic User Interface GUI Basic Dr. Umaporn Supasitthimethee Computer Programming II -2- Java GUI A graphical user interface (GUI) makes a system user-friendly and easy to use. Creating a GUI requires
More information2110: GUIS: Graphical User Interfaces
2110: GUIS: Graphical User Interfaces Their mouse had a mean time between failure of a week it would jam up irreparably, or... jam up on the table--... It had a flimsy cord whose wires would break. Steve
More informationCSE 331. Event-driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT
CSE 331 Event-driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT slides created by Marty Stepp based on materials by M. Ernst, S. Reges, D. Notkin, R. Mercer, Wikipedia http://www.cs.washington.edu/331/
More informationAll the Swing components start with J. The hierarchy diagram is shown below. JComponent is the base class.
Q1. If you add a component to the CENTER of a border layout, which directions will the component stretch? A1. The component will stretch both horizontally and vertically. It will occupy the whole space
More informationWidgets. Overview. Widget. Widgets Widget toolkits Lightweight vs. heavyweight widgets Swing Widget Demo
Widgets Overview Widgets Widget toolkits Lightweight vs. heavyweight widgets Swing Widget Demo Widget Widget is a generic name for parts of an interface that have their own behavior: buttons, progress
More informationChina Jiliang University Java. Programming in Java. Java Swing Programming. Java Web Applications, Helmut Dispert
Java Programming in Java Java Swing Programming Java Swing Design Goals The overall goal for the Swing project was: To build a set of extensible GUI components to enable developers to more rapidly develop
More informationEnterprise JavaBeans 2.1
Enterprise JavaBeans 2.1 STEFAN DENNINGER and INGO PETERS with ROB CASTANEDA translated by David Kramer APress Media, LLC Enterprise JavaBeans 2.1 Copyright 2003 by Stefan Denninger and Ingo Peters with
More informationPart 3: Graphical User Interface (GUI) & Java Applets
1,QWURGXFWLRQWR-DYD3URJUDPPLQJ (( Part 3: Graphical User Interface (GUI) & Java Applets EE905-GUI 7RSLFV Creating a Window Panels Event Handling Swing GUI Components ƒ Layout Management ƒ Text Field ƒ
More informationCSE 331. Event- driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT
CSE 331 Event- driven Programming and Graphical User Interfaces (GUIs) with Swing/AWT Lecturer: Michael Hotan slides created by Marty Stepp based on materials by M. Ernst, S. Reges, D. Notkin, R. Mercer,
More informationPROGRAMMING DESIGN USING JAVA (ITT 303) Unit 7
PROGRAMMING DESIGN USING JAVA (ITT 303) Graphical User Interface Unit 7 Learning Objectives At the end of this unit students should be able to: Build graphical user interfaces Create and manipulate buttons,
More informationCertified Eclipse Bundle
Certified Eclipse Bundle Turbo Professional Enterprise Integrated Installation >> Sample Applications >> Eclipse 3.3.2 (Europa) Framework with WTP 2.0, including: >> Business Intelligence and Reporting
More informationGUI Design. Overview of Part 1 of the Course. Overview of Java GUI Programming
GUI Design Michael B. Spring Department of Information Science and Telecommunications University of Pittsburgh spring@imap.pitt.edu http://www.sis.pitt.edu /~spring Overview of Part 1 of the Course Demystifying
More informationCertified Eclipse Bundle
Certified Eclipse Bundle Turbo Professional Enterprise Integrated Installation Sample Applications Eclipse 3.3.2 (Europa) Framework with WTP 2.0, including: Business Intelligence and Reporting Tools (BIRT)
More informationWorkaround Swing Bugs
Workaround Swing Bugs David Qiao, JIDE Software, Inc. BOF-5133 Background of Myself and JIDE CTO and Founder of JIDE Software, Inc. Heavily use Swing in the last several years Build components and frameworks
More information2010 가을학기부산대학교정보컴퓨터공학부 OVERVIEW OF GUI PROGRAMMING
2010 가을학기부산대학교정보컴퓨터공학부 OVERVIEW OF GUI PROGRAMMING Outline Graphic User Interface (GUI) Introduction AWT and Swing Graphics Programming Event Handling User Interface Components with Swing 2 Graphic User
More informationIntroduction to Graphical Interface Programming in Java. Introduction to AWT and Swing
Introduction to Graphical Interface Programming in Java Introduction to AWT and Swing GUI versus Graphics Programming Graphical User Interface (GUI) Graphics Programming Purpose is to display info and
More informationAdvanced Java Programming. Swing. Introduction to Swing. Swing libraries. Eran Werner, Tel-Aviv University Summer, 2005
Advanced Java Programming Swing Eran Werner, Tel-Aviv University Summer, 2005 19 May 2005 Advanced Java Programming, Summer 2005 1 Introduction to Swing The Swing package is part of the Java Foundation
More informationBasics of programming 3. Java GUI and SWING
Basics of programming 3 Java GUI and SWING Complex widgets Basics of programming 3 BME IIT, Goldschmidt Balázs 2 Complex widgets JList elements can be selected from a list JComboBox drop down list with
More informationAnnouncements. Introduction. Lecture 18 Java Graphics and GUIs. Announcements. CSE 331 Software Design and Implementation
CSE 331 Software Design and Implementation Lecture 18 Java Graphics and GUIs Announcements Leah Perlmutter / Summer 2018 Announcements Quiz 6 due Thursday 8/2 Homework 7 due Thursday 8/2 Regression testing
More informationCompanion ebook Available Pro Android Includes Android 1.5 SOURCE CODE ONLINE US $44.99
The EXPERT s VOIce in Open Source Pro Android Covers Google s Android Platform and its fundamental APIs, from basic concepts such as Android resources, intents, and content providers to advanced topics
More informationThe Abstract Windowing Toolkit. Java Foundation Classes. Swing. In April 1997, JavaSoft announced the Java Foundation Classes (JFC).
The Abstract Windowing Toolkit Since Java was first released, its user interface facilities have been a significant weakness The Abstract Windowing Toolkit (AWT) was part of the JDK form the beginning,
More informationGraphical User Interface (GUI)
Graphical User Interface (GUI) An example of Inheritance and Sub-Typing 1 Java GUI Portability Problem Java loves the idea that your code produces the same results on any machine The underlying hardware
More informationJava Swing. based on slides by: Walter Milner. Java Swing Walter Milner 2005: Slide 1
Java Swing based on slides by: Walter Milner Java Swing Walter Milner 2005: Slide 1 What is Swing? A group of 14 packages to do with the UI 451 classes as at 1.4 (!) Part of JFC Java Foundation Classes
More informationCSE 331 Software Design & Implementation
CSE 331 Software Design & Implementation Kevin Zatloukal Fall 2017 Java GUIs (Based on slides by Mike Ernst, Dan Grossman, David Notkin, Hal Perkins, Zach Tatlock) Reminders HW8 due today Section tomorrow
More informationSwing JTable. JTable
Swing JTable Corso di Principi di Progettazione del Software, a.a. 2017/18 12 Dicembre 2017 ing. Roberto Vergallo 1 JTable Tables are used to display data in a spreadsheet fashion The JTable is oriented
More informationTrees CSCI 201 Principles of Software Development
Trees CSCI 201 Principles of Software Development Jeffrey Miller, Ph.D. jeffrey.miller@usc.edu Outline Trees Program USC CSCI 201L Trees Overview JTree is a component that displays data in a treelike hierarchy
More informationGUI Components Continued EECS 448
GUI Components Continued EECS 448 Lab Assignment In this lab you will create a simple text editor application in order to learn new GUI design concepts This text editor will be able to load and save text
More informationCS 251 Intermediate Programming GUIs: Components and Layout
CS 251 Intermediate Programming GUIs: Components and Layout Brooke Chenoweth University of New Mexico Fall 2017 import javax. swing.*; Hello GUI public class HelloGUI extends JFrame { public HelloGUI ()
More informationPackages: Putting Classes Together
Packages: Putting Classes Together 1 Introduction 2 The main feature of OOP is its ability to support the reuse of code: Extending the classes (via inheritance) Extending interfaces The features in basic
More informationLearn Programming with Flash MX
Learn Programming with Flash MX Kristian Besley Ben Renow-Clarke APress Media, LLC Learn Programming with Flash MX Copyright 2004 by Kristian Besley and Ben Renow-Clarke Originally published by Apress
More informationChapter 6: Swing and Multimedia
Java by Definition Chapter 6: Swing and Multimedia Page 1 of 122 Chapter 6: Swing and Multimedia With the availability of cheap computers that support sound and high-speed animation the concept of multimedia
More informationJava Swing. Lists Trees Tables Styled Text Components Progress Indicators Component Organizers
Course Name: Advanced Java Lecture 19 Topics to be covered Java Swing Lists Trees Tables Styled Text Components Progress Indicators Component Organizers AWT to Swing AWT: Abstract Windowing Toolkit import
More informationPro Perl Parsing. Christopher M. Frenz
Pro Perl Parsing Christopher M. Frenz Pro Perl Parsing Copyright 2005 by Christopher M. Frenz Lead Editors: Jason Gilmore and Matthew Moodie Technical Reviewer: Teodor Zlatanov Editorial Board: Steve Anglin,
More informationIntroduction to Graphical User Interfaces (GUIs) Lecture 10 CS2110 Fall 2008
Introduction to Graphical User Interfaces (GUIs) Lecture 10 CS2110 Fall 2008 Announcements A3 is up, due Friday, Oct 10 Prelim 1 scheduled for Oct 16 if you have a conflict, let us know now 2 Interactive
More informationAn Introduction to Object-Oriented Programming with Visual Basic.NET
An Introduction to Object-Oriented Programming with Visual Basic.NET DAN CLARK APress Media, LLC An Introduction to Object-Oriented Programming with Visual Basic.NET Copyright 2002 by Dan Clark Originally
More informationGUI Basics. Object Orientated Programming in Java. Benjamin Kenwright
GUI Basics Object Orientated Programming in Java Benjamin Kenwright Outline Essential Graphical User Interface (GUI) Concepts Libraries, Implementation, Mechanics,.. Abstract Windowing Toolkit (AWT) Java
More informationSwing from A to Z Some Simple Components. Preface
By Richard G. Baldwin baldwin.richard@iname.com Java Programming, Lecture Notes # 1005 July 31, 2000 Swing from A to Z Some Simple Components Preface Introduction Sample Program Interesting Code Fragments
More informationcore 2 Basic Swing GUI Controls in Java 2
core Web programming Basic Swing GUI Controls in Java 2 1 2001-2003 Marty Hall, Larry Brown http:// Agenda New features Basic approach Summary of Swing components Starting points JApplet, JFrame Swing
More informationcore programming Basic Swing GUI Controls in Java Marty Hall, Larry Brown
core programming Basic Swing GUI Controls in Java 2 1 2001-2003 Marty Hall, Larry Brown http:// Agenda New features Basic approach Summary of Swing components Starting points JApplet, JFrame Swing equivalent
More informationVISUAL QUICKPRO GUIDE
VISUAL QUICKPRO GUIDE Red Hat Linux 6 Harold Davis Peachpit Press Visual QuickPro Guide Red Hat Linux 6 Harold Davis Peachpit Press 1249 Eighth Street Berkeley, CA 94710 510/524-2178 800/283-9444 510/524-2221
More informationProgramming graphics
Programming graphics Need a window javax.swing.jframe Several essential steps to use (necessary plumbing ): Set the size width and height in pixels Set a title (optional), and a close operation Make it
More informationJBoss 3.2 Deployment and Administration
JBoss 3.2 Deployment and Administration Meeraj Kunnumpurath APress Media, LLC }Boss 3.2 Deployment and Administration Copyright 2004 by Meeraj Kunnumpurath Originally published by Apress in 2004 Ali rights
More informationIndex SELF-STUDY. Symbols
SELF-STUDY 393 Index Symbols -... 239 "Event-to-property"... 144 "Faux" variables... 70 %... 239 ( )... 239 (Pme) paradigm... 14 *... 239 +... 239 /... 239 =... 239 = Null... 46 A A project... 24-25, 35
More informationHuman-Computer Interaction IS4300
Human-Computer Interaction IS4300 1 I4 Swing! Due Now Implement a Java applet to provide online ordering for your favorite restaurant. The interface need not be functional, but the controls should be laid
More informationWeek Chapter Assignment SD Technology Standards. 1,2, Review Knowledge Check JP3.1. Program 5.1. Program 5.1. Program 5.2. Program 5.2. Program 5.
Week Chapter Assignment SD Technology Standards 1,2, Review JP3.1 Review exercises Debugging Exercises 3,4 Arrays, loops and layout managers. (5) Create and implement an external class Write code to create
More informationGraphical User Interfaces (GUIs)
CMSC 132: Object-Oriented Programming II Graphical User Interfaces (GUIs) Department of Computer Science University of Maryland, College Park Model-View-Controller (MVC) Model for GUI programming (Xerox
More informationGraphical User Interface (GUI)
Graphical User Interface (GUI) Layout Managment 1 Hello World Often have a static method: createandshowgui() Invoked by main calling invokelater private static void createandshowgui() { } JFrame frame
More informationEvent Driven Programming
Event Driven Programming Part 1 Introduction Chapter 12 CS 2334 University of Oklahoma Brian F. Veale 1 Graphical User Interfaces So far, we have only dealt with console-based programs Run from the console
More informationPro.NET 4 Parallel Programming in C#
Pro.NET 4 Parallel Programming in C# Adam Freeman Pro.NET 4 Parallel Programming in C# Copyright 2010 by Adam Freeman All rights reserved. No part of this work may be reproduced or transmitted in any form
More informationFoundations of JSP Design Patterns
Foundations of JSP Design Patterns ANDREW PATZER EDITED BY MATTHEW MOODIE APress Media, LLC Foundatlons of JSP Design Patterns Copyright O 2004 by Andrew Patzer, Matthew Moodle Originally published by
More informationUNIT-V 1 KNREDDY JAVA PROGRAMMING
UNIT-V 1 KNREDDY UNIT-V Swings: The origin and design philosophy of swing, Components and containers, Layout managers, Event handling, Using a push button, jtextfield, jlabel and image icon, The swing
More informationEssential Series. Springer-Verlag London Ltd.
Essential Series Springer-Verlag London Ltd. Also in this series: Essential Visual Basic 4.0 fast 3-540-19998-5 Essential Delphi 2.0 fast 3-540-76026-1 Essential Java fast 3-540-76052-0 Essential Visual
More informationBASICS OF GRAPHICAL APPS
CSC 2014 Java Bootcamp Lecture 7 GUI Design BASICS OF GRAPHICAL APPS 2 Graphical Applications So far we ve focused on command-line applications, which interact with the user using simple text prompts In
More informationVisit for more.
Chapter 3: Getting Started with JAVA IDE Programming Informatics Practices Class XI (CBSE Board) Revised as per CBSE Curriculum 2015 Visit www.ip4you.blogspot.com for more. Authored By:- Rajesh Kumar Mishra,
More informationGraphics. Lecture 18 COP 3252 Summer June 6, 2017
Graphics Lecture 18 COP 3252 Summer 2017 June 6, 2017 Graphics classes In the original version of Java, graphics components were in the AWT library (Abstract Windows Toolkit) Was okay for developing simple
More informationGraphical User Interfaces. Comp 152
Graphical User Interfaces Comp 152 Procedural programming Execute line of code at a time Allowing for selection and repetition Call one function and then another. Can trace program execution on paper from
More informationIntroduction to concurrency and GUIs
Principles of Software Construction: Objects, Design, and Concurrency Part 2: Designing (Sub)systems Introduction to concurrency and GUIs Charlie Garrod Bogdan Vasilescu School of Computer Science 1 Administrivia
More informationContents. 1 Introduction to Computers, the Internet and the Web 1
jhtp4toc.fm Page vii Friday, January 11, 2002 12:01 PM Contents Preface xxxv 1 Introduction to Computers, the Internet and the Web 1 1.1 Introduction 2 1.2 What Is a Computer? 7 1.3 Computer Organization
More informationContainers. Atomic Components. Containment Hierarchy. Example Example 3.3 (revisited) Example DemoSwing.java
Atomic Components Containers An atomic component is: a low-level entity an entity that interacts with the user an entity that cannot hold other components Examples: buttons (), text fields (JTextField)
More informationEssential Angular for ASP.NET Core MVC
Essential Angular for ASP.NET Core MVC Adam Freeman Essential Angular for ASP.NET Core MVC Adam Freeman London, UK ISBN-13 (pbk): 978-1-4842-2915-6 ISBN-13 (electronic): 978-1-4842-2916-3 DOI 10.1007/978-1-4842-2916-3
More informationIntroduction... xv SECTION 1: DEVELOPING DESKTOP APPLICATIONS USING JAVA Chapter 1: Getting Started with Java... 1
Introduction... xv SECTION 1: DEVELOPING DESKTOP APPLICATIONS USING JAVA Chapter 1: Getting Started with Java... 1 Introducing Object Oriented Programming... 2 Explaining OOP concepts... 2 Objects...3
More informationGUI Programming. Chapter. A Fresh Graduate s Guide to Software Development Tools and Technologies
A Fresh Graduate s Guide to Software Development Tools and Technologies Chapter 12 GUI Programming CHAPTER AUTHORS Ang Ming You Ching Sieh Yuan Francis Tam Pua Xuan Zhan Software Development Tools and
More informationJFormDesigner 6 Documentation
Copyright 2004-2017 FormDev Software GmbH. All rights reserved. Contents 1 Introduction... 2 2 User Interface... 3 2.1 Menus... 4 2.2 Toolbars... 6 2.3 Design View... 7 2.3.1 Headers... 9 2.3.2 In-place-editing...
More information