Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

balls

By: a guest on Oct 5th, 2012  |  syntax: Java  |  size: 0.70 KB  |  views: 36  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import javax.swing.*;
  2. import java.awt.*;
  3. import java.awt.event.*;
  4.  
  5.  
  6. public class TicTacToeFrame extends JFrame
  7. {
  8.     private JButton square11;
  9.  
  10.     public TicTacToeFrame()
  11.     {
  12.         super("Tic-Tac-Toe");
  13.         setLayout(new GridBagLayout());
  14.         GridBagConstraints gbc = new GridBagConstraints();
  15.         gbc.fill = GridBagConstraints.HORIZONTAL;
  16.        
  17.         square11 = new JButton("");
  18.         gbc.fill = GridBagConstraints.HORIZONTAL;
  19.         gbc.gridx = 1;
  20.         gbc.gridy = 0;
  21.         add(square11, gbc);
  22.     }
  23.  
  24.     static public void main(String[] args) {
  25.         final TicTacToeFrame t = new TicTacToeFrame();
  26.         t.pack();
  27.         t.setVisible(true);
  28.     }
  29. }
clone this paste RAW Paste Data