Juego PDF
Juego PDF
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package systemplus;
import
import
import
import
java.awt.*;
java.awt.event.*;
javax.swing.*;
javax.swing.border.*;
1.1 of 3
2016.10.29 14:56:08
C:/Users/Insside/Documents/NetBeansProjects/Systemplus/src/systemplus/Juego.java
public String getParameter(String key, String def) {
return isStandalone ? System.getProperty(key, def) :
(getParameter(key) != null ? getParameter(key) : def);
}
//Construct the applet
public Juego() {
}
//Initialize the applet
public void init() {
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
//Component initialization
private void jbInit() throws Exception {
jCheckBox1.addActionListener(al);
titledBorder1 = new TitledBorder("");
seggen.addActionListener(al);
this.setSize(new Dimension(420,320));
jPanel1.setLayout(null);
jPanel2.setBackground(Color.blue);
jPanel2.setBorder(BorderFactory.createLineBorder(Color.black));
jPanel2.setBounds(new Rectangle(16, 11, 362, 227));
jPanel2.setLayout(gridLayout1);
gridLayout1.setColumns(45);
gridLayout1.setHgap(0);
gridLayout1.setRows(25);
gridLayout1.setVgap(0);
jPanel3.setBorder(BorderFactory.createRaisedBevelBorder());
jPanel3.setBounds(new Rectangle(19, 268, 384, 39));
jPanel3.setLayout(null);
seggen.setBounds(new Rectangle(182, 6, 83, 26));
seggen.setMargin(new Insets(2, 1, 2, 1));
seggen.setText("Siguiente");
about.setBounds(new Rectangle(345, 9, 28, 20));
about.setToolTipText("");
about.setMargin(new Insets(2, 1, 2, 1));
about.setText("?");
borrar.setText("Limpiar");
borrar.setMargin(new Insets(2, 1, 2, 1));
borrar.setBounds(new Rectangle(86, 6, 83, 26));
jCheckBox1.setText("Punto");
jCheckBox1.setBounds(new Rectangle(10, 10, 71, 18));
est.setFont(new java.awt.Font("Dialog", 1, 12));
est.setBorder(BorderFactory.createRaisedBevelBorder());
est.setPreferredSize(new Dimension(4, 4));
est.setHorizontalAlignment(SwingConstants.CENTER);
est.setText("0");
est.setBounds(new Rectangle(283, 7, 42, 25));
jPanel4.setBackground(new Color(192, 255, 192));
jPanel4.setBorder(BorderFactory.createLoweredBevelBorder());
jPanel4.setBounds(new Rectangle(14, 8, 392, 250));
jPanel4.setLayout(null);
jPanel1.setBorder(BorderFactory.createLineBorder(Color.black));
this.getContentPane().add(jPanel1, BorderLayout.CENTER);
jPanel3.add(jCheckBox1, null);
jPanel3.add(est, null);
jPanel3.add(borrar, null);
jPanel3.add(seggen, null);
jPanel3.add(about, null);
jPanel1.add(jPanel4, null);
jPanel4.add(jPanel2, null);
jPanel1.add(jPanel3, null);
for(int i = 0; i < area.length; i++)
for(int j = 0; j < area[0].length; j++)
{
area[i][j] = new JLabel();
area[i][j].setBackground(Color.white);
area[i][j].setOpaque(true);
area[i][j].setBorder(BorderFactory.createLineBorder(Color.black));
area[i][j].addMouseListener(ml);
area[i][j].addMouseMotionListener(mml);
aux = area[i][j];
jPanel2.add(aux);
}
borrar.addActionListener(al);
about.addActionListener(al);
}
//Start the applet
public void start() {
}
//Stop the applet
public void stop() {
}
//Destroy the applet
public void destroy() {
}
//Get Applet information
public String getAppletInfo() {
return "Applet Information";
}
//Get parameter info
public String[][] getParameterInfo() {
return null;
}
//Main method
public static void main(String[] args) {
Juego applet = new Juego();
applet.isStandalone = true;
JFrame frame = new JFrame();
//EXIT_ON_CLOSE == 3
frame.setDefaultCloseOperation(3);
frame.setTitle("EL JUEGO DE LA VIDA - SYSTEMPLUS");
frame.getContentPane().add(applet, BorderLayout.CENTER);
applet.init();
applet.start();
frame.setSize(440,360);
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
frame.setLocation((d.width - frame.getSize().width) / 2, (d.height - frame.getSize().height) / 2);
frame.setVisible(true);
}
//static initializer for setting look & feel
static {
try {
//UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
//UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
}
catch(Exception e) {
}
}
void mostrarAbout()
{
JOptionPane.showMessageDialog(this,"EL JUEGO DE LA VIDA\n\nby Jose Alexis Correa Valencia, 2016. All rights reserved.\n\[email protected]\n\nhttp://www.insside.com","About...",JOptionPane.PLAIN_MESSAGE);
}
}
2.1 of 3
2016.10.29 14:56:08
C:/Users/Insside/Documents/NetBeansProjects/Systemplus/src/systemplus/Juego.java
3.1 of 3
2016.10.29 14:56:08