Container(AWT) - PowerPoint PPT Presentation

About This Presentation
Title:

Container(AWT)

Description:

Figure 12.1 Some Swing subclasses of JComponent. Figure 12.3 An ... class DrawOn extends Canvas { public void paint(Graphics g) { g.drawString('Hi there',20,20) ... – PowerPoint PPT presentation

Number of Views:12
Avg rating:3.0/5.0
Slides: 3
Provided by: gene92
Category:

less

Transcript and Presenter's Notes

Title: Container(AWT)


1
Container(AWT)
JComponent
JLabel
JList
JPanel
Abstract Button
JScroll Pane
JCombo Box
JMenu Bar
JOption Pane
JMenu Item
JButton
JToggle Button
JCheckBox
JRadioButton
Figure 12.1 Some Swing subclasses of JComponent
2
import java.awt. import java.applet.Applet   pu
blic class ButtonCanvas extends Applet
public void init() add(new
Button("one")) add(new Button("two"))
DrawOn canvas new DrawOn()
add(canvas) canvas.setBackground(Color.pink
) canvas.setSize(150,150) class
DrawOn extends Canvas public void
paint(Graphics g) g.drawString("Hi
there",20,20)
Figure 12.3 An AWT applet
Write a Comment
User Comments (0)
About PowerShow.com