Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package guiBall;
- public class NewJFrame extends javax.swing.JFrame {
- public NewJFrame() {
- initComponents();
- }
- //@SuppressWarnings("unchecked")
- private void initComponents() {
- //jPanel1 = new javax.swing.JPanel();
- jInternalFrame1 = new javax.swing.JInternalFrame();
- jPanel2 = new javax.swing.JPanel();
- jButton1 = new javax.swing.JButton();
- jTextField1 = new javax.swing.JTextField();
- jButton2 = new javax.swing.JButton();
- jInternalFrame2 = new javax.swing.JInternalFrame();
- jPanel3 = new javax.swing.JPanel();
- jPanel4 = new javax.swing.JPanel();
- jTextField2 = new javax.swing.JTextField();
- jTextField3 = new javax.swing.JTextField();
- jPanel1.setBackground(new java.awt.Color(246, 244, 150));
- jPanel1.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
- javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
- jPanel1.setLayout(jPanel1Layout);
- jPanel1Layout.setHorizontalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 384, Short.MAX_VALUE));
- jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 342, Short.MAX_VALUE));
- jInternalFrame1.setTitle("Scale Game");
- jInternalFrame1.setVisible(true);
- javax.swing.GroupLayout jInternalFrame1Layout = new javax.swing.GroupLayout(jInternalFrame1.getContentPane());
- jInternalFrame1.getContentPane().setLayout(jInternalFrame1Layout);
- jInternalFrame1Layout.setHorizontalGroup(jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 388, Short.MAX_VALUE));
- jInternalFrame1Layout.setVerticalGroup(
- jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGap(0, 352, Short.MAX_VALUE)
- );
- setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
- jPanel2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
- jButton1.setFont(new java.awt.Font("Comic Sans MS", 1, 15));
- jButton1.setText("New game");
- jTextField1.setText("Chances : ");
- jTextField1.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- jTextField1ActionPerformed(evt);
- }
- });
- jButton2.setFont(new java.awt.Font("Comic Sans MS", 1, 15));
- jButton2.setText("Exit");
- javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
- jPanel2.setLayout(jPanel2Layout);
- jPanel2Layout.setHorizontalGroup(
- jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
- .addContainerGap()
- .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(35, 35, 35)
- .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 33, Short.MAX_VALUE)
- .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addContainerGap())
- );
- jPanel2Layout.setVerticalGroup(
- jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel2Layout.createSequentialGroup()
- .addContainerGap()
- .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jButton1)
- .addComponent(jButton2))
- .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- );
- jInternalFrame2.setBackground(new java.awt.Color(246, 210, 242));
- jInternalFrame2.setTitle("Scale game");
- jInternalFrame2.setFont(new java.awt.Font("Impact", 1, 15)); // NOI18N
- jInternalFrame2.setVisible(true);
- jPanel3.setBackground(new java.awt.Color(191, 69, 19));
- jPanel3.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED));
- javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
- jPanel3.setLayout(jPanel3Layout);
- jPanel3Layout.setHorizontalGroup(
- jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGap(0, 0, Short.MAX_VALUE)
- );
- jPanel3Layout.setVerticalGroup(
- jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGap(0, 361, Short.MAX_VALUE)
- );
- jPanel4.setBackground(new java.awt.Color(220, 14, 24));
- jPanel4.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
- jTextField2.setFont(new java.awt.Font("Ubuntu", 1, 15)); // NOI18N
- jTextField2.setText("Highscore :");
- jTextField2.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- jTextField2ActionPerformed(evt);
- }
- });
- jTextField3.setFont(new java.awt.Font("Ubuntu", 1, 15)); // NOI18N
- jTextField3.setText("Score : ");
- javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
- jPanel4.setLayout(jPanel4Layout);
- jPanel4Layout.setHorizontalGroup(
- jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel4Layout.createSequentialGroup()
- .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE))
- );
- jPanel4Layout.setVerticalGroup(
- jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
- .addGap(0, 0, Short.MAX_VALUE)
- .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
- );
- javax.swing.GroupLayout jInternalFrame2Layout = new javax.swing.GroupLayout(jInternalFrame2.getContentPane());
- jInternalFrame2.getContentPane().setLayout(jInternalFrame2Layout);
- jInternalFrame2Layout.setHorizontalGroup(
- jInternalFrame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(jPanel4, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- );
- jInternalFrame2Layout.setVerticalGroup(
- jInternalFrame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jInternalFrame2Layout.createSequentialGroup()
- .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- );
- javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
- getContentPane().setLayout(layout);
- layout.setHorizontalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(jInternalFrame2)
- );
- layout.setVerticalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
- .addGap(0, 0, 0)
- .addComponent(jInternalFrame2)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- );
- pack();
- }
- private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {
- // TODO add your handling code here:
- }
- private void jTextField2ActionPerformed(java.awt.event.ActionEvent evt) {
- // TODO add your handling code here:
- }
- public static void main(String args[]) {
- /* try {
- for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
- if ("Nimbus".equals(info.getName())) {
- javax.swing.UIManager.setLookAndFeel(info.getClassName());
- break;
- }
- }
- } catch (ClassNotFoundException ex) {
- java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (InstantiationException ex) {
- java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (IllegalAccessException ex) {
- java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- } catch (javax.swing.UnsupportedLookAndFeelException ex) {
- java.util.logging.Logger.getLogger(NewJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- }*/
- java.awt.EventQueue.invokeLater(new Runnable() {
- public void run() {
- new NewJFrame().setVisible(true);
- }
- });
- }
- private javax.swing.JButton jButton1;
- private javax.swing.JButton jButton2;
- private javax.swing.JInternalFrame jInternalFrame1;
- private javax.swing.JInternalFrame jInternalFrame2;
- private javax.swing.JPanel jPanel1;
- private javax.swing.JPanel jPanel2;
- private javax.swing.JPanel jPanel3;
- private javax.swing.JPanel jPanel4;
- private javax.swing.JTextField jTextField1;
- private javax.swing.JTextField jTextField2;
- private javax.swing.JTextField jTextField3;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement