0rioNN

Untitled

May 18th, 2014
646
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package chessgame;
  2.  
  3. import javax.swing.*;
  4. import java.awt.*;
  5.  
  6. public class Chess {
  7.    
  8.     private JFrame f;
  9.     private JPanel p;
  10.     private JButton b1;
  11.     private JLabel lab;
  12.    
  13.    
  14.    
  15.     public Chess(){
  16.        
  17.         gui();
  18.        
  19.     }
  20.    
  21.     public void gui(){
  22.        
  23.         f = new JFrame("Jogo de Xadrez");
  24.         f.setVisible(true);
  25.         f.setSize(600,600);
  26.         f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  27.        
  28.        
  29.         p = new JPanel();
  30.         p.setBackground(Color.GRAY);
  31.        
  32.         b1 = new JButton("PLayer 1 VS Player 2");
  33.         b1.addActionListener(new ActionListener());
  34.         lab = new JLabel("lol");
  35.        
  36.        
  37.        
  38.         p.add(lab);
  39.         p.add(b1);
  40.        
  41.        
  42.         f.add(p);
  43.        
  44.        
  45.        
  46.     }
  47.    
  48.    
  49.     public static void main (String [] args){
  50.        
  51.         new Chess();
  52.     }
  53.    
  54.    
  55. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×