package jogoDaMemoria;
public class Principal extends javax.swing.JFrame {
public Principal() {
initComponents();
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jComboBoxLinha = new javax.swing.JComboBox();
jComboBoxColuna = new javax.swing.JComboBox();
botaoVirar = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jComboBoxLinha.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "1", "2", "3" }));
jComboBoxLinha.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jComboBoxLinhaActionPerformed(evt);
}
});
jComboBoxColuna.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "1", "2", "3" }));
jComboBoxColuna.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jComboBoxColunaActionPerformed(evt);
}
});
botaoVirar.setText("Virar");
botaoVirar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
botaoVirarActionPerformed(evt);
}
});
jLabel1.setText("Linha");
jLabel2.setText("Coluna");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(38, 38, 38)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(botaoVirar)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jComboBoxColuna, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jComboBoxLinha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(34, 34, 34)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel2)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addContainerGap(230, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(57, 57, 57)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jComboBoxLinha, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1))
.addGap(30, 30, 30)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jComboBoxColuna, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2))
.addGap(52, 52, 52)
.addComponent(botaoVirar)
.addContainerGap(98, Short.MAX_VALUE))
);
pack();
}// </editor-fold>
private void jComboBoxLinhaActionPerformed(java.awt.event.ActionEvent evt) {
jComboBoxLinha.getSelectedIndex();
}
private void jComboBoxColunaActionPerformed(java.awt.event.ActionEvent evt) {
jComboBoxColuna.getSelectedIndex();
}
private void botaoVirarActionPerformed(java.awt.event.ActionEvent evt) {
GameEngine game = new GameEngine();
game.Matriz();
game.VirarCarta(jComboBoxLinha.getSelectedIndex(),jComboBoxColuna.getSelectedIndex());
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Principal().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton botaoVirar;
private javax.swing.JComboBox jComboBoxColuna;
private javax.swing.JComboBox jComboBoxLinha;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
// End of variables declaration
GameEngine game= null;
}