Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Collections;
- import java.util.List;
- import java.util.ArrayList;
- import javax.swing.*;
- import javax.swing.Icon;
- import javax.swing.ImageIcon;
- import java.awt.*;
- import java.awt.event.*;
- public class Jogo extends JFrame{
- List<Carta> morto = new ArrayList<Carta>();
- Baralho monte;
- Carta c;
- Icon iconeFecha, iconeVazio, iconeCria1, iconeCria4, iconeEmbaralha, iconeExibe, iconeZera;
- JButton btFechado, btAberto;
- JButton btCria1, btCria4, btEmbaralha, btExibe, btZeratudo;
- public Jogo(){
- super ("Jojo de Baralho dok peta");
- setLayout(new BorderLayout()); //configura o layout do programa
- iconeFecha = new ImageIcon (getClass().getResource("fechado2.png"));
- iconeVazio = new ImageIcon (getClass().getResource("vazio.png"));
- iconeCria1 = new ImageIcon (getClass().getResource("desconhecido.png"));
- iconeCria4 = new ImageIcon (getClass().getResource("desconhecido4.png"));
- iconeEmbaralha = new ImageIcon (getClass().getResource("shuffle.png"));
- iconeExibe = new ImageIcon (getClass().getResource("exibe.png"));
- iconeZera = new ImageIcon (getClass().getResource("zera.png"));
- btFechado = new JButton (iconeVazio);
- btAberto = new JButton (iconeVazio);
- monte = new Baralho ();
- morto.clear();
- JPanel painelcentro = new JPanel(new GridLayout(1,2,5,5)); //Espaço entre as tabelas linha, coluna, espaço laterais
- painelcentro.add(btFechado);
- painelcentro.add(btAberto);
- add(painelcentro, BorderLayout.CENTER);
- JPanel painelsul = new JPanel (new FlowLayout());
- btCria1 = new JButton(iconeCria1);
- btCria4 = new JButton(iconeCria4);
- btEmbaralha = new JButton (iconeEmbaralha);
- btExibe = new JButton (iconeExibe);
- btZeratudo = new JButton (iconeZera);
- painelsul.add(btCria1);
- painelsul.add(btCria4);
- painelsul.add(btEmbaralha);
- painelsul.add(btExibe);
- painelsul.add(btZeratudo);
- add(painelsul, BorderLayout.SOUTH);
- }
- public static void main(String[] args) {
- Jogo j= new Jogo();
- //j.setDefaultCloseOperations(JFrame.EXIT_ON_CLOSE);
- j.setSize(1280, 720);
- j.setLocation(0,0);
- j.setVisible(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement