3
cs413_chapt02. ppt CS413 Advanced 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 Components Develop functionally rich GUI interfaces More complete set of GUI components than AWT More advanced features New Java Class’ JEditorPane Rendering of Styled objects i.e. HTML pages, build a web browser Swing Actions To build reusable, user-interface logic components JSplitPane and JTabbedPane Multiple-document-interface components For organizing GUI elements

Cs413_chapt02.ppt CS413 Advanced Swing Graphical User Interface Components Text: Advanced Java 2 Platform: Chapter 2 Abstract Windowing Toolkit (AWT) Library

Embed Size (px)

Citation preview

Page 1: Cs413_chapt02.ppt CS413 Advanced Swing Graphical User Interface Components Text: Advanced Java 2 Platform: Chapter 2 Abstract Windowing Toolkit (AWT) Library

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

Page 2: Cs413_chapt02.ppt CS413 Advanced Swing Graphical User Interface Components Text: Advanced Java 2 Platform: Chapter 2 Abstract Windowing Toolkit (AWT) Library

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

Page 3: Cs413_chapt02.ppt CS413 Advanced Swing Graphical User Interface Components Text: Advanced Java 2 Platform: Chapter 2 Abstract Windowing Toolkit (AWT) Library

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