+
1 3 3

: Java !

  1. #1
    ncuxo       ncuxo
    31.01.2008
    155
    ()
    0
    : 0 (: 0).

     Java !

    . Google

    :
    import java.io.*;
    import java.net.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.border.*;
    
    public class Game extends JFrame
    ##
    private JButton b1;
    private JButton b2;
    private JButton b3;
    private JButton b4;
    private JButton b5;
    private JButton b6;
    private JButton b7;
    private JButton b8;
    private JButton b9;
    private JLabel Count;
    private JLabel Status;
    	Game(String title)
    	##
    		setTitle(title);
    		Container c =  getContentPane();
    		c.setLayout(new BorderLayout());
    		JPanel p1=new JPanel();	//    .
    		JPanel p2=new JPanel();	//    
    		p1.setLayout(new BorderLayout());	//      
    		p2.setLayout(new GridLayout(3,3,3,3));	// 
    		JLabel Count=new JLabel("C: ");
    		JLabel Status=new JLabel(": ");
    		JButton b1=new JButton("");
    		JButton b2=new JButton("");
    		JButton b3=new JButton("");
    		JButton b4=new JButton("");
    		JButton b5=new JButton("");
    		JButton b6=new JButton("");
    		JButton b7=new JButton("");
    		JButton b8=new JButton("");
    		JButton b9=new JButton("");
    		c.add(p1, BorderLayout.NORTH);	//      
    		c.add(p2, BorderLayout.CENTER);
    		p1.add(Count, BorderLayout.NORTH);
    		p1.add(Status, BorderLayout.CENTER);
    		p2.add(b1);
    		p2.add(b2);
    		p2.add(b3);
    		p2.add(b4);
    		p2.add(b5);
    		p2.add(b6);
    		p2.add(b7);
    		p2.add(b8);
    		p2.add(b9);
    		b1.addActionListener(new Track());
    		b2.addActionListener(new Track());
    		b3.addActionListener(new Track());
    		b4.addActionListener(new Track());
    		b5.addActionListener(new Track());
    		b6.addActionListener(new Track());
    		b7.addActionListener(new Track());
    		b8.addActionListener(new Track());
    		b9.addActionListener(new Track());
    		setAlwaysOnTop(true);
    		setResizable(false);
    		setSize(160,200);
    		setLocation(500,300);
    		setVisible(true);
    	}
    	
    	public static void main(String[] args)
    	##
    		Game XO=new Game("Game");
    		XO.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    	}
    	class Track implements ActionListener
    	##
    		public void actionPerformed(ActionEvent e)
    	##
    		if(e.getSource()==b1)
    		##
    			System.out.println("Yes!");
    		}
    		else
    		##
    			System.out.println("No!");
    		}
    	}
    	}
    }
    , ( ).

  2. #2
    Web DemoS       DemoS
    22.02.2007
    476
    ()
    0
    : 0 (: 0).

    ncuxo
    . Google
    , , , .
    : JButton b1=new JButton("");
    : b1=new JButton("");
    .

  3. #3
    ncuxo       ncuxo
    31.01.2008
    155
    ()
    0
    : 0 (: 0).

    , , Java
    , ( ).