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

import java.awt.event.*;

public class Line03 extends JFrame {


  public Line03(String caption) {
    setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
    setTitle(caption);
    this.getContentPane().add( new CCanvas(), 
       BorderLayout.CENTER );
  }


    public static void main(String args[]) {
      Line03 f = new Line03("3. Linie");
     	f.setSize(650,450);
    	f.setVisible(true);
    }


}




class CCanvas extends Canvas {

 public void paint (Graphics g)
  {
    g.drawRect(100,100,500,300);  // left,top,width,height
    //g.drawRect(600,400,-500,-300);  // l,t,w,h
    g.drawLine(100,100,600,400);
    g.drawLine(100,400,600,100);

    g.drawLine(100,100,350,50);
    g.drawLine(350,50,600,100);
  }
}


