import java.awt.*; import java.awt.event.*; import java.applet.Applet; import java.awt.image.*; public class Vaiad extends Applet implements ActionListener{ Button edasi=new Button("Alusta"); TextField tf1=new TextField("5",3); TextField tf2=new TextField("50",3); TextField tf3=new TextField("50",3); int x1=120,x2=125,y1=150,y2=200,alla=0, labim=5,i=0; public Vaiad(){ add(tf1); add(tf2); add(tf3); add(edasi); edasi.addActionListener(this); } public void paint(Graphics g){ g.setColor(Color.blue); g.fillRect( 150, 200, 50, 40 ); g.fillRect( 150, 100, 5, 100 ); g.setColor(Color.white); g.fillRect( 154, 204, 10, 10 ); g.setColor(Color.black); g.fillRect( x1, y1, 30, 30 ); g.fillOval(160, 240, 12, 12); g.fillOval(180, 240, 12, 12); g.drawRect( x2, y2+i, labim, 50 ); g.drawLine(1,250,400,250); } public void pai(Graphics g,int i){ g.fillRect( x1, y1+i, 30, 30 ); if((y1+i+30)>y2){ System.out.println("ttt"); g.drawRect( x2, y2+i-30, labim, 50 ); }else{ g.drawRect( x2, y2, labim, 50 ); } } public void actionPerformed(ActionEvent e){ labim=Integer.parseInt(tf1.getText().trim()); pikk=Integer.parseInt(tf2.getText().trim()); sugav=Integer.parseInt(tf3.getText().trim()); Graphics g=getGraphics(); g.setColor(Color.white); g.fillRect( 1, 1, 400 ,400); paint(getGraphics()); for(;i<70;i++){ g.setColor(Color.black); pai(getGraphics(),i); try{Thread.sleep(20);}catch(Exception ex){} g.setColor(Color.white); pai(g,i); } g.setColor(Color.black); g.fillRect( x1, y1+i, 30 ,30); g.drawRect( x2, y2+i-30, labim, 50 ); g.drawLine(1,250,400,250); i=0; } public static void main(String argumendid[]){ Frame f=new Frame(" Pokker "); f.add(new Vaiad()); f.setSize(400, 400); f.setVisible(true); f.addWindowListener(new ara()); } }