Download presentation
Presentation is loading. Please wait.
Published byKelley Cannon Modified over 8 years ago
2
Past Computing Environments: Swing Ian Smith
3
UI Toolkits (History Lesson) 4 Programming tools for building interfaces 4 Originally in Java you had AWT 4 AWT sucks 4 AWT is based on “peers” 4 JDK 1.0 (and 0.8, 0.9) shipped with AWT Lots of cheers, lots of screams
4
UI Toolkits (History Continued) 4 Backing away from AWT event model 4 JDK 1.1 shipped with new event model 4 Backing away from peers 4 Several efforts underway to avoid peers 4 Netscape offers IFC 4 Different JVMs differ significantly
5
Simplified Timeline 4 Early 1997, 100% Java UI work begins Netscape & Sun join forces 4 March 1997: Java One Demo & “Swing” 4 Summer 1997: Swing 0.3 released 4 Fall 1997: Versions fast an furious 4 December 1997: API “Frozen”: Swing 0.7 4 February 1998: Swing 1.0 release
6
What’s Swing (JFC?) 4 Set of UI Components & MVC 4 JDK 1.1 Event Model & Beans 4 Pluggable Look & Feel 4 Java 2D 4 Compatible with AWT but in JDK 1.2 4 Accessibility 4 Drag And Drop
7
Questionable Graphic
8
Swing Components 4 Swing is 250 classes, 75 interfaces 4 The obvious (button, scrollbar, checkbox) 4 MS competitors (combo box, internal frame, split pane, tool bar, tool tip, etc) 4 The monsters (text & table) 4 A few choosers (file chooser, color chooser, previewers)
9
Swing & MVC 4 All components have an explicit model 4 View & Controller are fused 4 E.g. JAbstractButtonModel for Button, RadioButton, CheckBox, etc. 4 Linkage in both directions 4 Apps can listen to the model 4 Very sophisticated Document model 4 Supercool for database applications
10
Swing Event Model (Beans) 4 Everything is done with “listeners” E.g. “ addActionListener() ” to a JButton E.g. “ addChangeListener() ” to a ButtonModel 4 Simplifies linkage to application semantics but stiffens event model 4 All Swing objects are beans 4 People are already using them in builders
11
Pluggable Look & Feel 4 L&F is delegated to “separate” UI object 4 L&F is pluggable & dynamic 4 Organic, Windows, Motif (Mac? Mystery?) 4 Windows only works on Windows 4 Windows is pixel-accurate copy
12
Examples Organic Motif Win32
13
Java 2D 4 2D imaging model for Java (from adobe?) 4 Seems very sophisticated 4 All drawing in JDK 1.2 is done in terms of Java 2D 4 JDK 1.2 beta 2 is out, but Java 2D is very slow and has broken font metrics
14
Compatible (?) with AWT... 4 Generally, you can mix-n-match Swing with AWT 4 Some features work better in an all Swing world 4 When JDK 1.2 ships, Swing comes with 4 JDK 1.2 beta 2 shipped with Swing 0.6 4 Don’t use Swing with JDK 1.2 beta 2 if possible
15
Accessibility 4 Accessibility is part of JFC 4 Accessibility is a bunch of interfaces components can implement 4 “Roles” “Actions” “AccessibleText” 4 All Swing components are accessible 4 Call your computer on a cell phone: you are now blind
16
Drag And Drop 4 JDK 1.2 will have drag and drop 4 Interoperable with platform drag and drop 4 Version 0.95 of D&D spec is out 4 Swing plans to support D&D in JDK 1.2 (?) 4 Spec is borderline impenetrable
17
Why To (Not) Use Swing 4 + AWT is so broken as to be useless 4 + It’s supported by Sun/Netscape; they care 4 + Lots of output side power & flexibility 4 + Source is available 4 + Browser support (Activator) 4 - Designed for “standard apps” 4 - Not very flexible input 4 - Still has AWT heritage
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.