/* * NewJDialog.java * * Created on 21 februari 2006, 7:48 *//** * * @author Mats */public class NewJDialog extends javax.swing.JDialog { /** Creates new form NewJDialog */ public NewJDialog(java.awt.Frame parent, boolean modal) { super(parent, modal); initComponents(); } public static AccessorMethods am; public int world; public String myworld; /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); jTextField1 = new javax.swing.JTextField(); jButton1 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setModal(true); jLabel1.setText("What World"); jLabel1.setPreferredSize(new java.awt.Dimension(25, 14)); getContentPane().add(jLabel1, java.awt.BorderLayout.NORTH); jTextField1.setText("0"); getContentPane().add(jTextField1, java.awt.BorderLayout.SOUTH); jButton1.setText("jButton1"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); getContentPane().add(jButton1, java.awt.BorderLayout.WEST); pack(); } // </editor-fold>//GEN-END:initComponents private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed myworld = jTextField1.getText(); try { world=Integer.parseInt(myworld); } catch(NumberFormatException e) {} am.setServer(world); }//GEN-LAST:event_jButton1ActionPerformed /** * @param args the command line arguments */ public static void main() { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new NewJDialog(new javax.swing.JFrame(), true).setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; private javax.swing.JLabel jLabel1; private javax.swing.JTextField jTextField1; // End of variables declaration//GEN-END:variables}