Basic HTML version of Foils prepared Aug 14 1997

Foil 4 The rest of the HelloBean example

From JavaBeans Examples UC Web applications Certificate -- Aug 11,14 97. by Nancy McCracken


1 Additional methods make the bean have a visualization (canvas)
2 public Dimension getMinimumSize()
3 { return new Dimension (250, 70); }
4 public void paint(Graphics g)
5 {Font f = new Font("TimesRoman", Font.BOLD, 36);
6 g.setFont(f);
7 g.setColor(Color.red);
8 g.drawString("Hello " + sname + "!", 5, 50);
9 }
10 }
11 Use the paint method to draw on the canvas
12 New JDK1.1 method to tell Layout manager the minimum size of the canvas - also defines a (read only) property.

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Thu Jan 8 1998