import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Star extends JFrame { public Star(){
super( "Star" );
setSize( 300, 300 );
setVisible( true );
} public void paint( Graphics g ){
super.paint( g );
g.setColor( Color.BLUE );
g.drawLine(150,50,90,200);
g.drawLine(150,50,210,200);
g.drawLine(70,100,230,100);
g.drawLine(230,100,90,200);
g.drawLine(70,100,210,200);
}
public static void main( String args[] ){
Star star = new Star();
star.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
} }
|
|