Don't like ads? PRO users don't see any ads ;-)
Guest

GUI For mah friend

By: Arturxxx on Apr 26th, 2012  |  syntax: None  |  size: 6.99 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5. package gui;
  6.  
  7. /**
  8.  *
  9.  * @author Artur
  10.  */
  11. public class RBFishingGuild extends javax.swing.JFrame {
  12.  
  13.     /**
  14.      * Creates new form RBFishingGuild
  15.      */
  16.     public RBFishingGuild() {
  17.         initComponents();
  18.     }
  19.  
  20.     /**
  21.      * This method is called from within the constructor to initialize the form.
  22.      * WARNING: Do NOT modify this code. The content of this method is always
  23.      * regenerated by the Form Editor.
  24.      */
  25.     @SuppressWarnings("unchecked")
  26.     // <editor-fold defaultstate="collapsed" desc="Generated Code">
  27.     private void initComponents() {
  28.  
  29.         Title = new javax.swing.JLabel();
  30.         Description = new javax.swing.JLabel();
  31.         whatToFishLabel = new javax.swing.JLabel();
  32.         whatToFishBox = new javax.swing.JComboBox();
  33.         Start = new javax.swing.JButton();
  34.  
  35.         setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
  36.         setTitle("RBFishingGuild");
  37.  
  38.         Title.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
  39.         Title.setText("RBFishingGuild");
  40.  
  41.         Description.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
  42.         Description.setText("Your automated Fishing Guild Fisher.");
  43.  
  44.         whatToFishLabel.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
  45.         whatToFishLabel.setText("What to fish:");
  46.  
  47.         whatToFishBox.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
  48.         whatToFishBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Tuna and Swordfish", "Bass", "Lobster", "Shark" }));
  49.         whatToFishBox.addActionListener(new java.awt.event.ActionListener() {
  50.             public void actionPerformed(java.awt.event.ActionEvent evt) {
  51.                 whatToFishBoxActionPerformed(evt);
  52.             }
  53.         });
  54.  
  55.         Start.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
  56.         Start.setText("Start");
  57.         Start.addActionListener(new java.awt.event.ActionListener() {
  58.             public void actionPerformed(java.awt.event.ActionEvent evt) {
  59.                 StartActionPerformed(evt);
  60.             }
  61.         });
  62.  
  63.         javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  64.         getContentPane().setLayout(layout);
  65.         layout.setHorizontalGroup(
  66.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  67.             .addComponent(Start, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  68.             .addGroup(layout.createSequentialGroup()
  69.                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  70.                     .addGroup(layout.createSequentialGroup()
  71.                         .addContainerGap()
  72.                         .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  73.                             .addGroup(layout.createSequentialGroup()
  74.                                 .addComponent(whatToFishLabel)
  75.                                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  76.                                 .addComponent(whatToFishBox, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE))
  77.                             .addGroup(layout.createSequentialGroup()
  78.                                 .addGap(24, 24, 24)
  79.                                 .addComponent(Description))))
  80.                     .addGroup(layout.createSequentialGroup()
  81.                         .addGap(57, 57, 57)
  82.                         .addComponent(Title)))
  83.                 .addContainerGap(32, Short.MAX_VALUE))
  84.         );
  85.         layout.setVerticalGroup(
  86.             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  87.             .addGroup(layout.createSequentialGroup()
  88.                 .addComponent(Title)
  89.                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  90.                 .addComponent(Description)
  91.                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  92.                 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  93.                     .addComponent(whatToFishLabel)
  94.                     .addComponent(whatToFishBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  95.                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 20, Short.MAX_VALUE)
  96.                 .addComponent(Start))
  97.         );
  98.  
  99.         pack();
  100.     }// </editor-fold>
  101.  
  102.     private void StartActionPerformed(java.awt.event.ActionEvent evt) {
  103.         dispose();
  104.     }
  105.  
  106.     private void whatToFishBoxActionPerformed(java.awt.event.ActionEvent evt) {
  107.         // TODO add your handling code here:
  108.     }
  109.  
  110.     /**
  111.      * @param args the command line arguments
  112.      */
  113.     public static void main(String args[]) {
  114.         /*
  115.          * Set the Nimbus look and feel
  116.          */
  117.         //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
  118.         /*
  119.          * If Nimbus (introduced in Java SE 6) is not available, stay with the
  120.          * default look and feel. For details see
  121.          * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
  122.          */
  123.         try {
  124.             for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
  125.                 if ("Nimbus".equals(info.getName())) {
  126.                     javax.swing.UIManager.setLookAndFeel(info.getClassName());
  127.                     break;
  128.                 }
  129.             }
  130.         } catch (ClassNotFoundException ex) {
  131.             java.util.logging.Logger.getLogger(RBFishingGuild.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  132.         } catch (InstantiationException ex) {
  133.             java.util.logging.Logger.getLogger(RBFishingGuild.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  134.         } catch (IllegalAccessException ex) {
  135.             java.util.logging.Logger.getLogger(RBFishingGuild.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  136.         } catch (javax.swing.UnsupportedLookAndFeelException ex) {
  137.             java.util.logging.Logger.getLogger(RBFishingGuild.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  138.         }
  139.         //</editor-fold>
  140.  
  141.         /*
  142.          * Create and display the form
  143.          */
  144.         java.awt.EventQueue.invokeLater(new Runnable() {
  145.  
  146.             public void run() {
  147.                 new RBFishingGuild().setVisible(true);
  148.             }
  149.         });
  150.     }
  151.     // Variables declaration - do not modify
  152.     private javax.swing.JLabel Description;
  153.     private javax.swing.JButton Start;
  154.     private javax.swing.JLabel Title;
  155.     private javax.swing.JComboBox whatToFishBox;
  156.     private javax.swing.JLabel whatToFishLabel;
  157.     // End of variables declaration
  158. }