home *** CD-ROM | disk | FTP | other *** search
/ Web Programming with Visual J++ / Web_Programming_with_Visual_J_SAMS.NET_Version_1.0_1997.iso / source / chap16 / ex16a.java < prev    next >
Encoding:
Java Source  |  1996-09-15  |  436 b   |  21 lines

  1. import java.applet.*;
  2. import java.awt.*;
  3.  
  4. public class EX16A extends Applet
  5. {
  6.     protected Button SetColorButton = new Button("Set Color");
  7.     protected Button SetFontButton = new Button("Set Font");
  8.     protected String MyText = new String("This is the text being modified.");
  9.  
  10.     public void init()
  11.     {
  12.         add(SetColorButton);
  13.         add(SetFontButton);
  14.     }
  15.  
  16.     public void paint(Graphics g)
  17.     {
  18.         g.drawString(MyText, 20, 100);
  19.     }
  20. }
  21.