Upload
melanie-carson
View
228
Download
0
Embed Size (px)
Citation preview
cs413_chapt02.ppt
CS413Advanced Swing Graphical User Interface
Components
Text: Advanced Java 2 Platform: Chapter 2
Abstract Windowing Toolkit (AWT)Library of pre-written Java code for graphical and data manipulation
Java Foundation Class (JFC)
Swing ComponentsDevelop functionally rich GUI interfacesMore complete set of GUI components than AWT
More advanced features
New Java Class’
JEditorPaneRendering of Styled objects
i.e. HTML pages, build a web browser
Swing ActionsTo build reusable, user-interface logic components
JSplitPane and JTabbedPaneMultiple-document-interface componentsFor organizing GUI elements
cs413_chapt02.ppt
CS413
JTextComponent – ClassBase class for all Swing text components
JTextField – subclassSingle line text componentInput/outputNo special text stylingText is a single font and color
JPasswordField – subclassObtaining passwords
JTextArea – sublclassProvides a larger visible areaSupports larger plain-text documentsNo special text stylingText is a single font and color
JEditorPane – subclassEnhanced text-renderingSupports styled documents
formatting, font and colorRender HTML and Rich Text Format
(RTF)
JTextPane – subclassOnly styled documents and not plain textFine-grained control over the style of:
Each characterEach paragraph
cs413_chapt02.ppt
CS413
Sample:
WebBrowserPane.java (Page 31, Figure 2.1)
WebToolBar.java (Page 35, Figure 2.3)
WebBrowser.java (Page 38, Figure 2.4) – Initial Program