Created
November 4, 2017 13:37
-
-
Save glandaverde/7cfe25f4f3da133f24569eb6800f05fa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Decompiled with CFR 0_115. | |
* | |
* Could not load the following classes: | |
* number.NJFrame$1 | |
* number.NJFrame$2 | |
* number.NJFrame$3 | |
* number.NJFrame$4 | |
* number.NJFrame$5 | |
* number.NJFrame$6 | |
* number.NJFrame$7 | |
* number.NJFrame$8 | |
* org.netbeans.lib.awtextra.AbsoluteConstraints | |
* org.netbeans.lib.awtextra.AbsoluteLayout | |
*/ | |
package number; | |
import java.awt.Color; | |
import java.awt.Component; | |
import java.awt.Container; | |
import java.awt.Dimension; | |
import java.awt.EventQueue; | |
import java.awt.Font; | |
import java.awt.LayoutManager; | |
import java.awt.Rectangle; | |
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
import java.awt.event.FocusEvent; | |
import java.awt.event.FocusListener; | |
import java.util.Random; | |
import java.util.logging.Level; | |
import java.util.logging.Logger; | |
import javax.swing.BorderFactory; | |
import javax.swing.GroupLayout; | |
import javax.swing.JButton; | |
import javax.swing.JFormattedTextField; | |
import javax.swing.JFrame; | |
import javax.swing.JLabel; | |
import javax.swing.JPanel; | |
import javax.swing.LayoutStyle; | |
import javax.swing.UIManager; | |
import javax.swing.UnsupportedLookAndFeelException; | |
import javax.swing.border.Border; | |
import number.NJFrame; | |
import org.netbeans.lib.awtextra.AbsoluteConstraints; | |
import org.netbeans.lib.awtextra.AbsoluteLayout; | |
public class NJFrame | |
extends JFrame { | |
static int incognit = 0; | |
static int adivin = 0; | |
private JButton jButton1; | |
private JButton jButton2; | |
private JButton jButton3; | |
private static JFormattedTextField jFAdivina; | |
private static JFormattedTextField jFMax; | |
private static JFormattedTextField jFMin; | |
private JLabel jLabel1; | |
private JLabel jLabel2; | |
private static JLabel jLabel3; | |
private JLabel jLabel4; | |
private JPanel jPanel1; | |
private JPanel jPanel2; | |
public NJFrame() { | |
this.initComponents(); | |
} | |
private void initComponents() { | |
this.jPanel1 = new JPanel(); | |
jFAdivina = new JFormattedTextField(); | |
this.jButton1 = new JButton(); | |
this.jPanel2 = new JPanel(); | |
this.jLabel1 = new JLabel(); | |
this.jLabel2 = new JLabel(); | |
jFMin = new JFormattedTextField(); | |
jFMax = new JFormattedTextField(); | |
jLabel3 = new JLabel(); | |
this.jLabel4 = new JLabel(); | |
this.jButton2 = new JButton(); | |
this.jButton3 = new JButton(); | |
this.setDefaultCloseOperation(3); | |
this.setTitle("Adivina"); | |
this.setBackground(Color.white); | |
this.setBounds(new Rectangle(350, 150, 0, 0)); | |
this.setMaximumSize(new Dimension(600, 390)); | |
this.setResizable(false); | |
this.getContentPane().setLayout((LayoutManager)new AbsoluteLayout()); | |
this.jPanel1.setBackground(Color.white); | |
this.jPanel1.setMaximumSize(new Dimension(600, 390)); | |
jFAdivina.setBackground(Color.white); | |
jFAdivina.setBorder(null); | |
jFAdivina.setHorizontalAlignment(0); | |
jFAdivina.setText("0"); | |
jFAdivina.setCaretColor(Color.white); | |
jFAdivina.setFont(new Font("Sketch Rockwell", 0, 210)); | |
jFAdivina.addFocusListener((FocusListener)new /* Unavailable Anonymous Inner Class!! */); | |
this.jButton1.setBackground(Color.white); | |
this.jButton1.setFont(new Font("Sketch Rockwell", 0, 18)); | |
this.jButton1.setText("Adivinar"); | |
this.jButton1.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1)); | |
this.jButton1.addActionListener((ActionListener)new /* Unavailable Anonymous Inner Class!! */); | |
this.jPanel2.setBackground(new Color(49, 131, 255)); | |
this.jLabel1.setFont(new Font("Sketch Rockwell", 0, 24)); | |
this.jLabel1.setForeground(Color.white); | |
this.jLabel1.setText("Min:"); | |
this.jLabel2.setFont(new Font("Sketch Rockwell", 0, 24)); | |
this.jLabel2.setForeground(Color.white); | |
this.jLabel2.setText("Max:"); | |
jFMin.setBackground(new Color(49, 131, 255)); | |
jFMin.setBorder(null); | |
jFMin.setForeground(Color.white); | |
jFMin.setHorizontalAlignment(0); | |
jFMin.setText("0"); | |
jFMin.setCaretColor(Color.lightGray); | |
jFMin.setCaretPosition(0); | |
jFMin.setDisabledTextColor(Color.white); | |
jFMin.setFont(new Font("Sketch Rockwell", 0, 82)); | |
jFMin.addActionListener((ActionListener)new /* Unavailable Anonymous Inner Class!! */); | |
jFMin.addFocusListener((FocusListener)new /* Unavailable Anonymous Inner Class!! */); | |
jFMax.setBackground(new Color(49, 131, 255)); | |
jFMax.setBorder(null); | |
jFMax.setForeground(Color.white); | |
jFMax.setHorizontalAlignment(0); | |
jFMax.setText("0"); | |
jFMax.setCaretColor(Color.lightGray); | |
jFMax.setDisabledTextColor(Color.white); | |
jFMax.setFont(new Font("Sketch Rockwell", 0, 82)); | |
jFMax.addFocusListener((FocusListener)new /* Unavailable Anonymous Inner Class!! */); | |
GroupLayout jPanel2Layout = new GroupLayout(this.jPanel2); | |
this.jPanel2.setLayout(jPanel2Layout); | |
jPanel2Layout.setHorizontalGroup(jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(jFMax).addComponent(jFMin).addGroup(GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup().addContainerGap(-1, 32767).addComponent(this.jLabel1).addGap(51, 51, 51)).addGroup(jPanel2Layout.createSequentialGroup().addGap(49, 49, 49).addComponent(this.jLabel2).addContainerGap(53, 32767))); | |
jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(jPanel2Layout.createSequentialGroup().addGap(61, 61, 61).addComponent(this.jLabel1).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jFMin, -2, 93, -2).addGap(50, 50, 50).addComponent(this.jLabel2).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jFMax, -2, 95, -2).addContainerGap(19, 32767))); | |
jLabel3.setFont(new Font("Sketch Rockwell", 0, 24)); | |
jLabel3.setForeground(new Color(43, 185, 250)); | |
jLabel3.setHorizontalAlignment(0); | |
jLabel3.setText(" "); | |
this.jLabel4.setFont(new Font("Sketch Rockwell", 0, 24)); | |
this.jLabel4.setHorizontalAlignment(0); | |
this.jLabel4.setText("Adivina el numero:"); | |
this.jButton2.setBackground(Color.white); | |
this.jButton2.setFont(new Font("Sketch Rockwell", 0, 18)); | |
this.jButton2.setText("Rendirse"); | |
this.jButton2.setBorder(BorderFactory.createEtchedBorder()); | |
this.jButton2.addActionListener((ActionListener)new /* Unavailable Anonymous Inner Class!! */); | |
this.jButton3.setBackground(Color.white); | |
this.jButton3.setFont(new Font("Sketch Rockwell", 0, 18)); | |
this.jButton3.setText("Reset"); | |
this.jButton3.setBorder(BorderFactory.createEtchedBorder()); | |
this.jButton3.addActionListener((ActionListener)new /* Unavailable Anonymous Inner Class!! */); | |
GroupLayout jPanel1Layout = new GroupLayout(this.jPanel1); | |
this.jPanel1.setLayout(jPanel1Layout); | |
jPanel1Layout.setHorizontalGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(jPanel1Layout.createSequentialGroup().addComponent(this.jPanel2, -2, -1, -2).addGap(30, 30, 30).addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING, false).addComponent(jLabel3, -1, -1, 32767).addGroup(jPanel1Layout.createSequentialGroup().addComponent(this.jButton3, -2, 103, -2).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.jButton2, -2, 103, -2).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(this.jButton1, -2, 183, -2)).addComponent(jFAdivina).addComponent(this.jLabel4, -1, -1, 32767)).addContainerGap(-1, 32767))); | |
jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(jPanel1Layout.createSequentialGroup().addGap(25, 25, 25).addComponent(this.jLabel4).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, -1, 32767).addComponent(jFAdivina, -2, 199, -2).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel3).addGap(23, 23, 23).addGroup(jPanel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(this.jButton2, -2, 39, -2).addComponent(this.jButton1, -2, 39, -2).addComponent(this.jButton3, -2, 39, -2)).addGap(23, 23, 23)).addComponent(this.jPanel2, -1, -1, 32767)); | |
this.getContentPane().add((Component)this.jPanel1, (Object)new AbsoluteConstraints(0, 0, 600, 390)); | |
this.pack(); | |
} | |
private void jFMinActionPerformed(ActionEvent evt) { | |
} | |
private void jFMinFocusGained(FocusEvent evt) { | |
} | |
private void jFMaxFocusGained(FocusEvent evt) { | |
} | |
private void jFAdivinaFocusGained(FocusEvent evt) { | |
jFAdivina.setText(""); | |
} | |
private void jButton1ActionPerformed(ActionEvent evt) { | |
adivin = Integer.parseInt(jFAdivina.getText()); | |
if (adivin == incognit) { | |
jLabel3.setText("Adivinaste !"); | |
} else { | |
jLabel3.setText("No Adivinaste !"); | |
} | |
} | |
private void jButton2ActionPerformed(ActionEvent evt) { | |
jLabel3.setText("El numero era este: " + String.valueOf(incognit)); | |
} | |
private void jButton3ActionPerformed(ActionEvent evt) { | |
Random rand = new Random(); | |
incognit = rand.nextInt(Integer.parseInt(jFMax.getText()) - Integer.parseInt(jFMin.getText()) + 1) + Integer.parseInt(jFMin.getText()); | |
} | |
public static void main(String[] args) { | |
try { | |
for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { | |
if (!"Nimbus".equals(info.getName())) continue; | |
UIManager.setLookAndFeel(info.getClassName()); | |
break; | |
} | |
} | |
catch (ClassNotFoundException ex) { | |
Logger.getLogger(NJFrame.class.getName()).log(Level.SEVERE, null, ex); | |
} | |
catch (InstantiationException ex) { | |
Logger.getLogger(NJFrame.class.getName()).log(Level.SEVERE, null, ex); | |
} | |
catch (IllegalAccessException ex) { | |
Logger.getLogger(NJFrame.class.getName()).log(Level.SEVERE, null, ex); | |
} | |
catch (UnsupportedLookAndFeelException ex) { | |
Logger.getLogger(NJFrame.class.getName()).log(Level.SEVERE, null, ex); | |
} | |
EventQueue.invokeLater((Runnable)new /* Unavailable Anonymous Inner Class!! */); | |
} | |
static /* synthetic */ void access$000(NJFrame x0, FocusEvent x1) { | |
x0.jFAdivinaFocusGained(x1); | |
} | |
static /* synthetic */ void access$100(NJFrame x0, ActionEvent x1) { | |
x0.jButton1ActionPerformed(x1); | |
} | |
static /* synthetic */ void access$200(NJFrame x0, ActionEvent x1) { | |
x0.jFMinActionPerformed(x1); | |
} | |
static /* synthetic */ void access$300(NJFrame x0, FocusEvent x1) { | |
x0.jFMinFocusGained(x1); | |
} | |
static /* synthetic */ void access$400(NJFrame x0, FocusEvent x1) { | |
x0.jFMaxFocusGained(x1); | |
} | |
static /* synthetic */ void access$500(NJFrame x0, ActionEvent x1) { | |
x0.jButton2ActionPerformed(x1); | |
} | |
static /* synthetic */ void access$600(NJFrame x0, ActionEvent x1) { | |
x0.jButton3ActionPerformed(x1); | |
} | |
static /* synthetic */ JFormattedTextField access$700() { | |
return jFMin; | |
} | |
static /* synthetic */ JFormattedTextField access$800() { | |
return jFMax; | |
} | |
static /* synthetic */ JFormattedTextField access$900() { | |
return jFAdivina; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment