![java語(yǔ)言程序設(shè)計(jì)基礎(chǔ)篇第八英文PPT學(xué)習(xí)教案_第1頁(yè)](http://file2.renrendoc.com/fileroot_temp3/2021-9/25/8fdba799-3bba-48e1-81d1-05a60408aa30/8fdba799-3bba-48e1-81d1-05a60408aa301.gif)
![java語(yǔ)言程序設(shè)計(jì)基礎(chǔ)篇第八英文PPT學(xué)習(xí)教案_第2頁(yè)](http://file2.renrendoc.com/fileroot_temp3/2021-9/25/8fdba799-3bba-48e1-81d1-05a60408aa30/8fdba799-3bba-48e1-81d1-05a60408aa302.gif)
![java語(yǔ)言程序設(shè)計(jì)基礎(chǔ)篇第八英文PPT學(xué)習(xí)教案_第3頁(yè)](http://file2.renrendoc.com/fileroot_temp3/2021-9/25/8fdba799-3bba-48e1-81d1-05a60408aa30/8fdba799-3bba-48e1-81d1-05a60408aa303.gif)
![java語(yǔ)言程序設(shè)計(jì)基礎(chǔ)篇第八英文PPT學(xué)習(xí)教案_第4頁(yè)](http://file2.renrendoc.com/fileroot_temp3/2021-9/25/8fdba799-3bba-48e1-81d1-05a60408aa30/8fdba799-3bba-48e1-81d1-05a60408aa304.gif)
![java語(yǔ)言程序設(shè)計(jì)基礎(chǔ)篇第八英文PPT學(xué)習(xí)教案_第5頁(yè)](http://file2.renrendoc.com/fileroot_temp3/2021-9/25/8fdba799-3bba-48e1-81d1-05a60408aa30/8fdba799-3bba-48e1-81d1-05a60408aa305.gif)
版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、會(huì)計(jì)學(xué)1java語(yǔ)言程序設(shè)計(jì)基礎(chǔ)篇第八英文語(yǔ)言程序設(shè)計(jì)基礎(chǔ)篇第八英文2第1頁(yè)/共39頁(yè)3第2頁(yè)/共39頁(yè)4ButtonLabelText fieldCheck BoxRadio ButtonCombo Box第3頁(yè)/共39頁(yè)5第4頁(yè)/共39頁(yè)6 Dimension Font FontMetrics Component Graphics Object Color Container Panel Applet Frame Dialog Window JComponent JApplet JFrame JDialog Swing Components in the javax.swing packa
2、ge Lightweight Heavyweight Classes in the java.awt package 1 LayoutManager * 第5頁(yè)/共39頁(yè)7 Dimension Font FontMetrics Component Graphics Object Color Container Panel Applet Frame Dialog Window JComponent JApplet JFrame JDialog Swing Components in the javax.swing package Lightweight Heavyweight Classes i
3、n the java.awt package 1 LayoutManager * JPanel Container classes can contain other GUI components.第6頁(yè)/共39頁(yè)8 Dimension Font FontMetrics Component Graphics Object Color Container Panel Applet Frame Dialog Window JComponent JApplet JFrame JDialog Swing Components in the javax.swing package Lightweight
4、 Heavyweight Classes in the java.awt package 1 LayoutManager * JPanel The helper classes are not subclasses of Component. They are used to describe the properties of GUI components such as graphics context, colors, fonts, and dimension.第7頁(yè)/共39頁(yè)9 JMenuItem JCheckBoxMenuItem AbstractButton JComponent
5、JMenu JRadioButtonMenuItem JToggleButton JCheckBox JRadioButton JComboBox JInternalFrame JLayeredPane JList JMenuBar JOptionPane JPopupMenu JProgressBar JFileChooser JScrollBar JScrollPane JSeparator JSplitPane JSlider JTabbedPane JTable JTableHeader JTextField JTextComponent JTextArea JToolBar JToo
6、lTip JTree JRootPane JPanel JPasswordField JColorChooser JLabel JEditorPane JSpinner JButton 第8頁(yè)/共39頁(yè)10 JMenuItem JCheckBoxMenuItem AbstractButton JComponent JMenu JRadioButtonMenuItem JToggleButton JCheckBox JRadioButton JComboBox JInternalFrame JLayeredPane JList JMenuBar JOptionPane JPopupMenu JP
7、rogressBar JFileChooser JScrollBar JScrollPane JSeparator JSplitPane JSlider JTabbedPane JTable JTableHeader JTextField JTextComponent JTextArea JToolBar JToolTip JTree JRootPane JPanel JPasswordField JColorChooser JLabel JEditorPane JSpinner JButton 第9頁(yè)/共39頁(yè)11 JMenuItem JCheckBoxMenuItem AbstractBu
8、tton JComponent JMenu JRadioButtonMenuItem JToggleButton JCheckBox JRadioButton JComboBox JInternalFrame JLayeredPane JList JMenuBar JOptionPane JPopupMenu JProgressBar JFileChooser JScrollBar JScrollPane JSeparator JSplitPane JSlider JTabbedPane JTable JTableHeader JTextField JTextComponent JTextAr
9、ea JToolBar JToolTip JTree JRootPane JPanel JPasswordField JColorChooser JLabel JEditorPane JSpinner JButton 第10頁(yè)/共39頁(yè)12AWTEventFontFontMetricsComponentGraphicsObjectColorCanvasButtonTextComponentLabelListCheckBoxGroupCheckBoxChoiceContainerPanelAppletFrameDialogFileDialogWindowTextFieldTextAreaMenu
10、ComponentMenuItemMenuBarMenuScrollbarLayoutManager第11頁(yè)/共39頁(yè)13第12頁(yè)/共39頁(yè)14Runimport javax.swing.*;public class MyFrame public static void main(String args) JFrame frame = new JFrame(Test Frame); frame.setSize(400, 300); frame.setVisible(true); frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE); MyF
11、rame第13頁(yè)/共39頁(yè)15/ Add a button into the frameframe.getContentPane().add( new JButton(OK);RunMyFrameWithComponentsTitle barContent pane第14頁(yè)/共39頁(yè)16/ Add a button into the frameframe.getContentPane().add( new JButton(OK);Title barContent pane/ Add a button into the frameframe.add( new JButton(OK);第15頁(yè)/共
12、39頁(yè)17 javax.swing.JFrame +JFrame() +JFrame(title: String) +setSize(width: int, height: int): void +setLocation(x: int, y: int): void +setVisible(visible: boolean): void +setDefaultCloseOperation(mode: int): void +setLocationRelativeTo(c: Component): void +pack(): void Creates a default frame with no
13、 title. Creates a frame with the specified title. Specifies the size of the frame. Specifies the upper-left corner location of the frame. Sets true to display the frame. Specifies the operation when the frame is closed. Sets the location of the frame relative to the specified component. If the compo
14、nent is null, the frame is centered on the screen. Automatically sets the frame size to hold the components in the frame. 第16頁(yè)/共39頁(yè)18第17頁(yè)/共39頁(yè)19第18頁(yè)/共39頁(yè)20ShowFlowLayoutRun第19頁(yè)/共39頁(yè)21 java.awt.FlowLayout -alignment: int -hgap: int -vgap: int +FlowLayout() +FlowLayout(alignment: int) +FlowLayout(alig
15、nment: int, hgap: int, vgap: int) The alignment of this layout manager (default: CENTER). The horizontal gap of this layout manager (default: 5 pixels). The vertical gap of this layout manager (default: 5 pixels). Creates a default FlowLayout manager. Creates a FlowLayout manager with a specified al
16、ignment. Creates a FlowLayout manager with a specified alignment, horizontal gap, and vertical gap. The get and set methods for these data fields are provided in the class, but omitted in the UML diagram for brevity. 第20頁(yè)/共39頁(yè)22ShowGridLayoutRun第21頁(yè)/共39頁(yè)23 java.awt.GridLayout -rows: int -columns: in
17、t -hgap: int -vgap: int +GridLayout() +GridLayout(rows: int, columns: int) +GridLayout(rows: int, columns: int, hgap: int, vgap: int) The number of rows in this layout manager (default: 1). The number of columns in this layout manager (default: 1). The horizontal gap of this layout manager (default:
18、 0). The vertical gap of this layout manager (default: 0). Creates a default GridLayout manager. Creates a GridLayout with a specified number of rows and columns. Creates a GridLayout manager with a specified number of rows and columns, horizontal gap, and vertical gap. The get and set methods for t
19、hese data fields are provided in the class, but omitted in the UML diagram for brevity. 第22頁(yè)/共39頁(yè)24add(Component, constraint), where constraint is BorderLayout.EAST, BorderLayout.SOUTH, BorderLayout.WEST, BorderLayout.NORTH, or BorderLayout.CENTER. 第23頁(yè)/共39頁(yè)25ShowBorderLayoutRun第24頁(yè)/共39頁(yè)26 java.awt.
20、BorderLayout -hgap: int -vgap: int +BorderLayout() +BorderLayout(hgap: int, vgap: int) The horizontal gap of this layout manager (default: 0). The vertical gap of this layout manager (default: 0). Creates a default BorderLayout manager. Creates a BorderLayout manager with a specified number of horiz
21、ontal gap, and vertical gap. The get and set methods for these data fields are provided in the class, but omitted in the UML diagram for brevity. 第25頁(yè)/共39頁(yè)27第26頁(yè)/共39頁(yè)28第27頁(yè)/共39頁(yè)29第28頁(yè)/共39頁(yè)30Font NamesStandard font names that are supported in all platforms are: SansSerif, Serif, Monospaced, Dialog, o
22、r DialogInput.Font StyleFont.PLAIN (0), Font.BOLD (1), Font.ITALIC (2), and Font.BOLD + Font.ITALIC (3)第29頁(yè)/共39頁(yè)31第30頁(yè)/共39頁(yè)32第31頁(yè)/共39頁(yè)33第32頁(yè)/共39頁(yè)34TestPanelsRun A button A textfield 12 buttons frame p2 p1 第33頁(yè)/共39頁(yè)35 java.awt.Container +add(comp: Component): Component +add(comp: Component, index: in
23、t): Component +remove(comp: Component): void +getLayout(): LayoutManager +setLayout(l: LayoutManager): void +paintComponents(g: Graphics): void Adds a component to the container. Adds a component to the container with the specified index. Removes the component from the container. Returns the layout
24、manager for this container. Sets the layout manager for this container. Paints each of the components in this container. java.awt.Component -font: java.awt.Font -background: java.awt.Color -foreground: java.awt.Color -preferredSize: Dimension -visible: boolean +getWidth(): int +getHeight(): int +getX(): int +getY(): int The font of this component. The background color of this component. The foreground color of this component. The preferred size of this component. Indicat
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年企業(yè)福利協(xié)議范本
- 2025年藥用空心膠囊項(xiàng)目規(guī)劃申請(qǐng)報(bào)告模稿
- 2025年區(qū)域一體化發(fā)展戰(zhàn)略規(guī)劃協(xié)議
- 2025年農(nóng)業(yè)產(chǎn)品買賣合同規(guī)范
- 2025年產(chǎn)品分銷權(quán)合同
- 2025年公共區(qū)域綠化苗木合同
- 2025年中介企業(yè)勞務(wù)合作合同樣本
- 2025年離婚協(xié)議書財(cái)產(chǎn)分割及子女撫養(yǎng)策劃大綱
- 2025年港口業(yè)投資項(xiàng)目規(guī)劃申請(qǐng)報(bào)告模范
- 2025年聚醚多元醇項(xiàng)目提案報(bào)告模稿
- GB 4706.20-2004家用和類似用途電器的安全滾筒式干衣機(jī)的特殊要求
- 無(wú)紙化會(huì)議系統(tǒng)解決方案
- 佛教空性與緣起課件
- 上海鐵路局勞動(dòng)安全“八防”考試題庫(kù)(含答案)
- 《愿望的實(shí)現(xiàn)》教學(xué)設(shè)計(jì)
- 效率提升和品質(zhì)改善方案
- 中山大學(xué)抬頭信紙中山大學(xué)橫式便箋紙推薦信模板a
- 義務(wù)教育學(xué)科作業(yè)設(shè)計(jì)與管理指南
- 《汽車發(fā)展史》PPT課件(PPT 75頁(yè))
- 常暗之廂(7規(guī)則-簡(jiǎn)體修正)
- 反詐騙防詐騙主題教育宣傳圖文PPT教學(xué)課件
評(píng)論
0/150
提交評(píng)論