import java.awt.*;
import java.awt.event.*;
import javax.swing.*;


public class Line01a extends JFrame {

  public Line01a() {
    setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
    setTitle("1. Beispiel");
    CCanvasL canl = new CCanvasL();
    this.getContentPane().add(canl, BorderLayout.CENTER );
//this.getContentPane().add(new CCanvasR(), BorderLayout.WEST );    
  }




    public static void main(String args[]) {
      Line01a f = new Line01a();
      f.setTitle("Line 01aaa. Beispiel");
      f.setSize(300,200);
    	f.setVisible(true);
    }


}



class CCanvasL extends Canvas {

  public void paint (Graphics g)
  {
    g.setColor(Color.RED);
    g.drawLine(0,0,1000,0);

    int x = 80;
    for (int i=0; i<60; i++) {
      g.drawLine(x,40,x,100);
      x += 1+ 10*Math.random();
    }
    System.out.println("paint-montag");
  }
  
}


class CCanvasR extends Canvas {

  public void paint (Graphics g)
  {
    int x = 80;
    for (int i=0; i<60; i++) {
      g.drawLine(x,100,x,150);
      x += 1+ 10*Math.random();
    }
    System.out.println("paint-dienstag");
  }
  
}


