All pastes #452793 Raw Edit

Untitled

public text v1 · immutable
·published 2007-04-22 14:48 UTC
rendered paste body
paint-metoden i klassen clientGUI:

    //Denna metod ritar upp korten som skall synas pa bordet
    public void paintCards(int[] othersCards, int middleCards, String[] yourCards, int[] playerPoints){
    	p1cards = null; 
        p2cards = null; 
        p3cards = null; 
        p4cards = null;
        mcards = null;
    	
    	this.yourCards = yourCards;
    	this.playername1.setText("pelddle");
    	this.playername2.setText("pesfdlle");
    	this.playername3.setText("pesfdlle");
    	this.playername4.setText("pedsfe");
    			
            	//tar bort kort for spelare 1
                if(p1cards != null){
                for(int j = 0; j < p1cards.length; j++)
                    getContentPane().remove(p1cards[j]);
                }
                
                javax.swing.JLabel[] p1cards = new javax.swing.JLabel[this.yourCards.length];
                //ritar upp kort for spelare 1
                for(int i = this.yourCards.length - 1; i >= 0; i--){
                	System.out.println("p1cards/" + yourCards[i] + ".gif");
                    p1cards[i] = new javax.swing.JLabel();
                    p1cards[i].setIcon(new javax.swing.ImageIcon("p1cards/" + yourCards[i] + ".gif"));
                    
                    getContentPane().add(p1cards[i], new org.netbeans.lib.awtextra.AbsoluteConstraints(235 + i*14, 155 - i*3, -1, -1), getContentPane().getComponentCount() - 1);
                }


metoden skall anropas ifrån klassen clientMonitor...

gui.paintCards(this.othersCards, this.middleCards, this.yourCards, this.playerScore);