- importjava.awt.Color;
- importjava.awt.Frame;
- importjava.awt.Graphics;
- importjavax.*;
-
- importjavax.swing.JFrame;
- importjavax.swing.JPanel;
- publicclassHelicoper{
- publicHelicoper(){
-
-
- }
- publicstaticvoidmain(String[]args){
- JFrameframe=newJFrame();
- frame.setSize(400,300);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.setVisible(true);
- Panelpanel=newPanel();
- frame.add(panel);
- }
- }
-
-
- classPanelextendsJPanel{
-
- publicvoidpaint(Graphicsg){
- super.paint(g);
-
-
-
- g.setColor(Color.CYAN);
- g.fillOval((15-12),(31-12),12*2,12*2);
-
- g.fillPolygon(newint[]{62,63,65,69,77,93,108},newint[]{11,10,9,8,7,6,6},7);
- g.fillPolygon(newint[]{62,77,93,101,105,107,108},newint[]{11,10,9,8,7,6,6},7);
-
- g.fillPolygon(newint[]{112,113,115,119,127,143,158},newint[]{6,5,4,3,2,1,1},7);
- g.fillPolygon(newint[]{112,127,143,151,155,157,158},newint[]{6,5,4,3,2,1,1},7);
-
-
-
- g.setColor(Color.GREEN);
- g.fillPolygon(
- newint[]{158,147,139,124,120,92,76,50,46,37,41,14,15,75,89,142},
- newint[]{43,34,27,23,19,19,26,28,25,25,28,29,33,39,51,51},
- 16);
- g.fillArc(89+20,52-(52-43)*2,(158-89)-20,(52-43)*2,0,-70);
-
-
- g.setColor(Color.GRAY);
- g.fillPolygon(newint[]{87,123,124,74},newint[]{22,22,24,26},4);
- g.fillArc(131-10,38-(44-38),10,(44-38)*2,0,-90);
- g.fillPolygon(newint[]{74,81,131-10/2,131,124},newint[]{26,44,44,38,24},5);
- g.fillPolygon(newint[]{54,45,37,46},newint[]{31,31,25,25},4);
-
-
- g.fillPolygon(newint[]{24,17,14,13},newint[]{28,21,21,28},4);
- g.fillArc(13,19,4,4,160,-180);
-
-
- g.setColor(Color.RED);
- g.fillPolygon(newint[]{112,112,108,108},newint[]{19,10,10,19},4);
- g.fillOval(108,(10-4),4,4);
-
-
-
- g.setColor(Color.BLACK);
- g.fillPolygon(newint[]{147,133,128,139},newint[]{34,34,25,27},4);
- g.fillPolygon(newint[]{87,123,120,92},newint[]{22,22,19,19},4);
- g.fillPolygon(newint[]{129,120,116,124},newint[]{35,35,26,24},4);
- g.fillPolygon(newint[]{113,117,108,102},newint[]{26,35,35,26},4);
-
-
-
-
- g.drawPolyline(
- newint[]{158,147,139,124,120,92,76,50,46,37,41,14,15,75,89,142},
- newint[]{43,34,27,23,19,19,26,28,25,25,28,29,33,39,51,51},
- 16);
- g.drawArc(89+20,52-(52-43)*2,(158-89)-20,(52-43)*2,0,-70);
-
-
- g.drawPolyline(newint[]{147,133,128},newint[]{34,34,25},3);
-
- g.drawPolyline(newint[]{87,123},newint[]{22,22},2);
-
-
- g.drawPolyline(newint[]{74,124,131},newint[]{26,24,38},3);
- g.drawArc(131-10,38-(44-38),10,(44-38)*2,0,-90);
-
- g.drawPolyline(newint[]{74,81,131-10/2},newint[]{26,44,44},3);
- g.drawPolyline(newint[]{129,120,116},newint[]{35,35,26},3);
- g.drawPolyline(newint[]{113,117,108,102},newint[]{26,35,35,26},4);
-
-
- g.drawPolygon(newint[]{54,45,37,46},newint[]{31,31,25,25},4);
-
- g.drawLine(99,26,106,44);
- g.drawLine(99,32,101,32);
- g.drawLine(102,39,104,39);
-
-
- g.drawPolyline(newint[]{112,112,108,108},newint[]{19,10,10,19},4);
- g.drawOval(108,(10-4),4,4);
-
- g.drawArc(108-(108-62)*2,6-5,(108-62)*2,5*2,0,-90);
- g.drawArc(108-(108-62),6,(108-62)*2,5*2,180,-90);
-
- g.drawArc(112-(108-62),6-5*2,(108-62)*2,5*2,0,-90);
- g.drawArc(112,6-5,(108-62)*2,5*2,180,-90);
-
-
-
-
- g.drawPolyline(newint[]{24,17},newint[]{28,21},2);
- g.drawPolyline(newint[]{13,14},newint[]{21,28},2);
- g.drawArc(13,19,4,4,160,-180);
-
- g.drawOval((15-12),(31-12),12*2,12*2);
-
- g.drawArc((15-8),(31-8),8*2,8*2,20,120);
- g.drawArc((15-8),(31-8),8*2,8*2,-20,-50);
- g.drawArc((15-8),(31-8),8*2,8*2,-90,-100);
-
- g.drawArc(108,51,16,16,0,90);
- g.drawArc(130,51,16,16,20,90);
- g.drawArc(55,(51-8+6),100,(16-6),-20,-70);
-
- }
- }