need some help

Discussion in 'OT Technology' started by High Voltage, Apr 25, 2006.

  1. High Voltage

    High Voltage Guest

    this is my problem. its a java applet that displays a clock (this part works) but i had to add 3 check boxes to bold, italic, center the clock. that part doesnt work. any help and i willl be eternally greatful. thanks!

    import java.awt.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.Timer; 
    import java.awt.event.*;
    public class Clock extends JApplet {
     Calendar MyCal;
     Timer tm;
     tmListener tl;
     Image car;
        TextField output;
         Checkbox  box1;
         Checkbox  box2;
         Checkbox  box3;
     public void init()
      tl = new tmListener();
      tm = new Timer(1000, tl);
      setSize(new Dimension(600,500));
     public void paint(Graphics g) 
      MyCal = Calendar.getInstance();
      g.setFont(new Font("TimesRomen", Font.BOLD, 20));
      g.drawString("The time is " + MyCal.getTime(),20,20);
      box1    = new Checkbox( "Italic");           add(box1);
      box2    = new Checkbox( "Bold");           add(box1);
      box3    = new Checkbox( "Center");           add(box1);
      if (car != null)
       g.drawImage(car, 70, 70, this);
     public class tmListener implements ActionListener
      public void actionPerformed (ActionEvent e) 

Share This Page