Chapter 9: Objects and Classes

Similar documents
(CIP) Web /,. :, ISBN X.W T P393.4 CIP (2004) Web ( ) ( / ) : * 787

Swing-02.pdf

第1章

WinMDI 28

coverage2.ppt

3.1 num = 3 ch = 'C' 2

untitled

AL-M200 Series

Important Notice SUNPLUS TECHNOLOGY CO. reserves the right to change this documentation without prior notice. Information provided by SUNPLUS TECHNOLO

Windows XP

mvc

基于CDIO一体化理念的课程教学大纲设计

Microsoft Word - 3D手册2.doc

epub 94-3

JavaIO.PDF

ebook140-9

p.2 1 <HTML> 2 3 <HEAD> 4 <TITLE> </TITLE> 5 </HEAD> 6 7 <BODY> 8 <H3><B> </B></H3> 9 <H4><I> </I></H4> 10 </BODY> </HTML> 1. HTML 1. 2.

epub83-1

IP505SM_manual_cn.doc

Preface This guide is intended to standardize the use of the WeChat brand and ensure the brand's integrity and consistency. The guide applies to all d


Microsoft PowerPoint - Lecture7II.ppt

大 綱 最 有 利 標 目 的 及 類 型 最 有 利 標 之 辦 理 方 式 準 用 最 有 利 標 取 最 有 利 標 精 神 最 有 利 標 之 類 型 及 其 相 關 規 定 適 用 最 有 利 標 準 用 最 有 利 標 及 取 最 有 利 標 精 神 作 業 程 序 及 實 務 分 析

電機工程系認可證照清單 /7/1

Fun Time (1) What happens in memory? 1 i n t i ; 2 s h o r t j ; 3 double k ; 4 char c = a ; 5 i = 3; j = 2; 6 k = i j ; H.-T. Lin (NTU CSIE) Referenc

INTRODUCTION TO COM.DOC

Chapter 9: Objects and Classes

SDS 1.3

Microsoft Word - 生活禮儀柯友惠981

Microsoft Word - template.doc

RUN_PC連載_8_.doc

目 录 第 一 章 电 力 行 业 内 部 控 制 操 作 指 南 概 述... 1 第 二 章 内 部 控 制 规 范 体 系 建 设 与 运 行 第 三 章 内 部 环 境 建 设 第 一 节 组 织 架 构 第 二 节 发 展 战 略 第 三 节

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

1.ai

ebook140-8

27 :OPC 45 [4] (Automation Interface Standard), (Costom Interface Standard), OPC 2,,, VB Delphi OPC, OPC C++, OPC OPC OPC, [1] 1 OPC 1.1 OPC OPC(OLE f

Microsoft Word - 投影片ch23

Logitech Wireless Combo MK45 English

編輯要旨 一 教育部為了協助本國失學民眾 新住民及 其他國外朋友 有系統的學習華語文的 聽 說 讀 寫 算等識字能力及跨文化 適應 以培養具有基本公民素養的終身學 習者 特別委託新北市政府教育局新住民 文教輔導科團隊編輯本教材 二 依據上述目的 本教材共有六冊 並分為 六級 分級及單元名稱詳如下表

(Microsoft PowerPoint - UML\302\262\244\266_use case.ppt)

Microsoft Word - 三峽鎮衛生所_3_-張家宸.李永繁.doc

Microsoft Word - 武漢大學交流營心得_黃莉云_.doc

AN INTRODUCTION TO PHYSICAL COMPUTING USING ARDUINO, GRASSHOPPER, AND FIREFLY (CHINESE EDITION ) INTERACTIVE PROTOTYPING

6-1 Table Column Data Type Row Record 1. DBMS 2. DBMS MySQL Microsoft Access SQL Server Oracle 3. ODBC SQL 1. Structured Query Language 2. IBM

Microsoft Word - ch04三校.doc

Microsoft PowerPoint - STU_EC_Ch08.ppt

LSC操作说明

E3. 最 大 公 因 數 問 題 描 述 : 寫 一 程 式 求 兩 數 之 最 大 公 因 數 利 用 TextField 元 件 輸 入 正 整 數 M, N (1 N M 9999), 按 下 compute 按 鈕 後 計 算 正 整 數 M, N 的 最 大 公 因 數, 並 顯 示 於

PowerPoint Presentation

Microsoft Word - Front cover_white.doc

Learning Java

THIS DEVICE COMPLIES WITH PART 15 OF THE FCC RULES. OPERATION IS SUBJECT TOTHE FOLLOWING TWO CONDITIONS: (1) THIS DEVICE MAY NOT CAUSE HARMFUL INTERFE

Business Objects 5.1 Windows BusinessObjects 1

《大话设计模式》第一章

USING MAYA ANIMATION Keyset set Maya sets partitions MEL MEL copykey cutkey pastekey scalekey snapkey keytangent bakeresults MEL Command Reference Edi

第 一 节 认 识 自 我 的 意 义 一 个 人 只 有 认 识 自 我, 才 能 够 正 确 地 认 识 到 自 己 的 优 劣 势, 找 出 自 己 的 职 业 亮 点, 为 自 己 的 顺 利 求 职 推 波 助 澜 ; 一 个 人 只 有 认 识 自 我, 才 能 在 求 职 中 保 持

RunPC2_.doc

epub 66-4

附录J:Eclipse教程

目次 

CL-68x00,00,00,00,00, CL-78x00,00,00,00,6000 Spindle 181mm mm Spindle bore 181mm is standard. 255,5 or 5mm is option. Chuck is optional. You ca

Move Component Object selection Component selection UV Maya Hotkeys editor Maya USING MAYA POLYGONAL MODELING 55

Microsoft Word - SupplyIT manual 3_cn_david.doc

網路安全:理論與實務 第二版

EJB-Programming-4-cn.doc

CANVIO_AEROCAST_CS_EN.indd

Microsoft Word - OPIGIMAC 譯本.doc

1 Framework.NET Framework Microsoft Windows.NET Framework.NET Framework NOTE.NET NET Framework.NET Framework 2.0 ( 3 ).NET Framework 2.0.NET F

Microsoft PowerPoint _代工實例-1

ebook

ext-web-auth-wlc.pdf

穨control.PDF

Microsoft PowerPoint - plan08.ppt

2 2 3 DLight CPU I/O DLight Oracle Solaris (DTrace) C/C++ Solaris DLight DTrace DLight DLight DLight C C++ Fortran CPU I/O DLight AM


Adobe® Flash® 的 Adobe® ActionScript® 3.0 程式設計

有 不 同 想 法 馬 上 記 錄 下 來, 作 為 寫 作 和 較 特 殊 題 型 的 答 題 材 料 把 握 這 四 到, 再 加 上 考 試 用 書 的 重 點 整 理, 搭 配 服 用, 讓 課 文 與 你 不 再 有 距 離 2. 考 試 成 績 好 差, 心 情 也 好 差, 可 不 可

Microsoft PowerPoint - 協商談判(成大 ) [相容模式]

untitled

RUN_PC連載_10_.doc

Microsoft Word - Broker.doc

Transcription:

What is a JavaBean? JavaBean Java JavaBean Java JavaBean

JComponent tooltiptext font background foreground doublebuffered border preferredsize minimumsize maximumsize

JButton. Swing JButton JButton() JButton(String text) JButton(String text, Icon icon) JButton(Icon icon) Example 9.1: Using Buttons ButtonDemo

JLabel. : JLabel() JLabel(String text, int horizontalalignment) JLabel(String text) JLabel(Icon icon) JLabel(Icon icon, int horizontalalignment) Example 9.2: Using Labels LabelDemo

JTextField Example 9.3: Using Text Fields add TextFieldDemo

JTextArea. JTextArea(int rows, int columns) JTextArea(String s, int rows, int columns)

Example 9.4 Using Text Areas. JPanel JFrame DescriptionPanel 1 1 TextAreaDemo -jlblimage -jlbltitle -jtatextdescription +setimageicon +settitle +settextdescription +getminimumsize TextAreaDemo

JComboBox. JComboBox() Example 9.5: Using Combo Boxes ComboBoxDemo

JList. Example 9.6: Using Lists ListDemo

JCheckBox. Example 9.7: Using Check Boxes CheckBoxDemo

JRadioButton. Example 9.8: Using Radio Buttons RadioButtonDemo

Borders Swing JComponent. Example 9.9: Using Borders BorderDemo

Message Dialogs. Example 9.10: Using Message Dialogs DialogDemo

Menus Java JMenuBar, JMenu, JMenuItem, JCheckBoxMenuItem, and JRadioButtonMenuItem. Java

Example 9.11: Using Menus Objective: Create a user interface that performs arithmetic. The interface contains labels and text fields for Number 1, Number 2, and Result. The Result box displays the result of the arithmetic operation between Number 1 and Number 2. MenuDemo

Creating Multiple Windows The following slides show step-by-step how to create an additional window from an application or applet.

Creating Additional Windows, Step 1 Step 1: Create a subclass of JFrame (called a SubFrame) that tells the new window what to do. For example, all the GUI application programs extend JFrame and are subclasses of JFrame.

Creating Additional Windows, Step 2 Step 2: Create an instance of SubFrame in the application or applet. Example: SubFrame subframe = new SubFrame("SubFrame Title");

Creating Additional Windows, Step 3 Step 3: Create a JButton for activating the subframe. add(new JButton("Activate SubFrame"));

Creating Additional Windows, Step 4 Step 4: Override the actionperformed() method as follows: public actionperformed(actionevent e) { String actioncommand = e.getactioncommand(); if (e.target instanceof Button) { if ("Activate SubFrame".equals(actionCommand)) { subframe.setvisible(true); } } }

Example 9.12 Creating Multiple Windows This example creates a main window with a text area in the scroll pane, and a button named "Show Histogram." When the user clicks the button, a new window appears that displays a histogram to show the occurrence of the letters in the text MultipleWindowsDemo area. Histogram

JScrollBar A scroll bar is a control that enables the user to select from a range of values. The scrollbar appears in two styles: horizontal and vertical. Example 9.13: Using Scrollbars ScrollBarDemo

Scroll Bar Properties Minimal value Block decrement Block increment Maximal value Bubble Unit decrement Unit increment

JScrollPane A scroll pane is a component that supports automatically scrolling without coding. Example 9.14: Using Scroll Panes ScrollPaneDemo

Scroll Pane Structures Corner Component Column header Corner Component JViewport Row header Scrollable Component Vertical scroll bars Corner Component Corner Component Horizontal scroll bars

JTabbedPane A tabbed pane provides a set of mutually exclusive tabs for accessing multiple components. Example 9.15: Using Tabbed Panes TabbedPaneDemo