import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

/* <applet code="UpDownButton3.class" width="200" height="70"> </applet> */

public class UpDownButton3 extends JApplet {
  String str = "Hello World!";
  int x=20;
  JButton left, right;

  @Override
  public void init() {
    left  = new JButton("Left");
    right = new JButton("Right");
    left.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
	x-=10;
	repaint();
      }
    });
    right.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      x+=10;
      repaint();
    }
    });
    setLayout(new FlowLayout());
    add(left); add(right);
  }

  @Override
  public void paint(Graphics g) {
    super.paint(g);
    g.drawString("HELLO WORLD!", x, 55);
  }
}
