All pastes #968017 Raw Edit

Someone

public text v1 · immutable
·published 2008-04-02 19:51 UTC
rendered paste body

      package Schack;

import java.awt.Color;
import java.awt.Frame;
import java.awt.Graphics;
import javax.swing.JPanel;
import java.awt.Label;
import Exempel2.GrafikLek;

      public class Bild extends Frame {

              String player1;
              String player2;

              public int move;
 
      public int qizi;
      Label msg=new Label("Hej, detta är Arshos Schack 2008");
    	public static void main(String[] args){
    		
    	}
    public void work(Grafik applet) {
    	}

    public void paintComponent (Graphics page) {
    		super.paintComponent (page);
    			
    		int Y1[] = {0, 0, 50, 50};
    		int Y2[] = {50, 50, 100, 100};
    		int Y3[] = {100, 100, 150, 150};
    		int Y4[] = {150, 150, 200, 200};
    		int Y5[] = {200, 200, 250, 250};
    		int Y6[] = {250, 250, 300, 300};
    		int Y7[] = {300, 300, 350, 350};
    		int Y8[] = {350, 350, 400, 400};
    		
			int X1[] = {0, 50, 50, 0};
			int X2[] = {100, 150, 150, 100};
			int X3[] = {200, 250, 250, 200};
			int X4[] = {300, 350, 350, 300};
			
			int X5[] = {50, 100, 100, 50};
			int X6[] = {150, 200, 200, 150};
			int X7[] = {250, 300, 300, 250};
			int X8[] = {350, 400, 400, 350};
			
			page.setColor(Color.black);
			
			//första rad   Y1  X1-4
			page.fillPolygon(X1, Y1, X1.length);
			page.fillPolygon(X2, Y1, X2.length);
			page.fillPolygon(X3, Y1, X3.length);
			page.fillPolygon(X4, Y1, X4.length);
			
			//andra rad    Y2  X5-6
			page.fillPolygon(X5, Y2, X5.length);
			page.fillPolygon(X6, Y2, X6.length);
			page.fillPolygon(X7, Y2, X7.length);
			page.fillPolygon(X8, Y2, X8.length);
    		
			//tredje rad   Y3  X1-4
			page.fillPolygon(X1, Y3, X1.length);
			page.fillPolygon(X2, Y3, X2.length);
			page.fillPolygon(X3, Y3, X3.length);
			page.fillPolygon(X4, Y3, X4.length);
			
			//fjärde rad    Y4  X5-6
			page.fillPolygon(X5, Y4, X5.length);
			page.fillPolygon(X6, Y4, X6.length);
			page.fillPolygon(X7, Y4, X7.length);
			page.fillPolygon(X8, Y4, X8.length);
			
			//femte rad   Y5  X1-4
			page.fillPolygon(X1, Y5, X1.length);
			page.fillPolygon(X2, Y5, X2.length);
			page.fillPolygon(X3, Y5, X3.length);
			page.fillPolygon(X4, Y5, X4.length);
			
			//sjätte rad    Y6  X5-6
			page.fillPolygon(X5, Y6, X5.length);
			page.fillPolygon(X6, Y6, X6.length);
			page.fillPolygon(X7, Y6, X7.length);
			page.fillPolygon(X8, Y6, X8.length);
			
			//sjunde rad   Y7  X1-4
			page.fillPolygon(X1, Y7, X1.length);
			page.fillPolygon(X2, Y7, X2.length);
			page.fillPolygon(X3, Y7, X3.length);
			page.fillPolygon(X4, Y7, X4.length);
			
			//åttonde rad    Y8  X5-6
			page.fillPolygon(X5, Y8, X5.length);
			page.fillPolygon(X6, Y8, X6.length);
			page.fillPolygon(X7, Y8, X7.length);
			page.fillPolygon(X8, Y8, X8.length);
    		
    		
    	}
    }