pallavi11's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
New Members
Active Posts:
13 (0.02 per day)
Joined:
28-July 12
Profile Views:
403
Last Active:
User is offline Sep 21 2012 08:55 AM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   pallavi11 has not set their status

Posts I've Made

  1. In Topic: insert data to data base from a text field

    Posted 2 Aug 2012

    Still not able to solve the problem
  2. In Topic: display the contents of text field in another frame to print the data

    Posted 28 Jul 2012

    i dont know how to display that. unable to do the coding
  3. In Topic: display date in a text field

    Posted 28 Jul 2012

    it is a text field not a test field

    sorry
  4. In Topic: going from one frame to another

    Posted 28 Jul 2012

    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    package my.uts;
    
    import javax.swing.JFrame;
    import java.sql.*;
    import javax.swing.JOptionPane;
    import javax.swing.table.DefaultTableModel;
    /**
     *
     * @author Administrator
     */
    public class UtsUI extends javax.swing.JFrame {
    
        /**
         * Creates new form UtsUI
         */
        public UtsUI() {
            initComponents();
        }
    
        /**
         * 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.
         */
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents() {
    
            buttonGroup1 = new javax.swing.ButtonGroup();
            jFrame1 = new javax.swing.JFrame();
            jLabel4 = new javax.swing.JLabel();
            jRadioButton3 = new javax.swing.JRadioButton();
            jRadioButton4 = new javax.swing.JRadioButton();
            jButton2 = new javax.swing.JButton();
            jFrame2 = new javax.swing.JFrame();
            jLabel5 = new javax.swing.JLabel();
            jLabel6 = new javax.swing.JLabel();
            jButton3 = new javax.swing.JButton();
            jLabel9 = new javax.swing.JLabel();
            jLabel10 = new javax.swing.JLabel();
            jTextField1 = new javax.swing.JTextField();
            jTextField2 = new javax.swing.JTextField();
            jLabel11 = new javax.swing.JLabel();
            jLabel12 = new javax.swing.JLabel();
            jLabel13 = new javax.swing.JLabel();
            jLabel14 = new javax.swing.JLabel();
            jLabel15 = new javax.swing.JLabel();
            jTextField3 = new javax.swing.JTextField();
            jTextField4 = new javax.swing.JTextField();
            jTextField5 = new javax.swing.JTextField();
            jTextField6 = new javax.swing.JTextField();
            jTextField7 = new javax.swing.JTextField();
            jScrollPane2 = new javax.swing.JScrollPane();
            jTable2 = new javax.swing.JTable();
            jFrame3 = new javax.swing.JFrame();
            jToggleButton1 = new javax.swing.JToggleButton();
            jScrollPane1 = new javax.swing.JScrollPane();
            jTable1 = new javax.swing.JTable();
            jLabel1 = new javax.swing.JLabel();
            jLabel2 = new javax.swing.JLabel();
            jLabel3 = new javax.swing.JLabel();
            jRadioButton1 = new javax.swing.JRadioButton();
            jRadioButton2 = new javax.swing.JRadioButton();
            jButton1 = new javax.swing.JButton();
            jLabel8 = new javax.swing.JLabel();
    
            jFrame1.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            jFrame1.setTitle("Page2");
            jFrame1.setAutoRequestFocus(false);
            jFrame1.setBounds(new java.awt.Rectangle(0, 0, 0, 0));
            jFrame1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
            jFrame1.setMinimumSize(new java.awt.Dimension(600, 400));
            jFrame1.setPreferredSize(new java.awt.Dimension(600, 400));
    
            jLabel4.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
            jLabel4.setForeground(new java.awt.Color(0, 0, 255));
            jLabel4.setText("Please mark your field");
    
            buttonGroup1.add(jRadioButton3);
            jRadioButton3.setText("Normal journey tickets");
            jRadioButton3.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jRadioButton3ActionPerformed(evt);
                }
            });
    
            buttonGroup1.add(jRadioButton4);
            jRadioButton4.setText("Nornal cancellation tickets");
            jRadioButton4.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jRadioButton4ActionPerformed(evt);
                }
            });
    
            jButton2.setText("Submit");
            jButton2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton2ActionPerformed(evt);
                }
            });
    
            javax.swing.GroupLayout jFrame1Layout = new javax.swing.GroupLayout(jFrame1.getContentPane());
            jFrame1.getContentPane().setLayout(jFrame1Layout);
            jFrame1Layout.setHorizontalGroup(
                jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jFrame1Layout.createSequentialGroup()
                    .addGap(148, 148, 148)
                    .addGroup(jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel4)
                        .addComponent(jButton2)
                        .addGroup(jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jRadioButton4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jFrame1Layout.createSequentialGroup()
                                .addComponent(jRadioButton3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addGap(24, 24, 24))))
                    .addContainerGap(137, Short.MAX_VALUE))
            );
            jFrame1Layout.setVerticalGroup(
                jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jFrame1Layout.createSequentialGroup()
                    .addGap(27, 27, 27)
                    .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(72, 72, 72)
                    .addComponent(jRadioButton3)
                    .addGap(14, 14, 14)
                    .addComponent(jRadioButton4)
                    .addGap(18, 18, 18)
                    .addComponent(jButton2)
                    .addContainerGap(62, Short.MAX_VALUE))
            );
    
            jFrame2.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            jFrame2.setTitle("Page3");
            jFrame2.setBackground(new java.awt.Color(204, 204, 204));
            jFrame2.setBounds(new java.awt.Rectangle(0, 0, 0, 0));
            jFrame2.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
            jFrame2.setMinimumSize(new java.awt.Dimension(600, 400));
            jFrame2.setName("Booking page");
            jFrame2.setPreferredSize(new java.awt.Dimension(600, 400));
    
            jLabel5.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
            jLabel5.setForeground(new java.awt.Color(0, 0, 255));
            jLabel5.setText("Daily booking form");
    
            jLabel6.setForeground(new java.awt.Color(0, 102, 204));
            jLabel6.setText("Booking window");
    
            jButton3.setText("Submit");
            jButton3.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton3ActionPerformed(evt);
                }
            });
    
            jLabel9.setText("Originating");
    
            jLabel10.setText("Destination");
    
            jLabel11.setText("Adult");
    
            jLabel12.setText("Children");
    
            jLabel13.setText("Class");
    
            jLabel14.setText("Train no");
    
            jLabel15.setText("Journey date");
    
            jTextField3.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jTextField3ActionPerformed(evt);
                }
            });
    
            jTextField5.setText("0");
    
            jTextField6.setText("0");
            jTextField6.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jTextField6ActionPerformed(evt);
                }
            });
    
            jTextField7.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jTextField7ActionPerformed(evt);
                }
            });
    
            jTable2.setModel(new javax.swing.table.DefaultTableModel(
                new Object [][] {
    
                },
                new String [] {
                    "name", "s_id", "address"
                }
            ));
            jScrollPane2.setViewportView(jTable2);
    
            javax.swing.GroupLayout jFrame2Layout = new javax.swing.GroupLayout(jFrame2.getContentPane());
            jFrame2.getContentPane().setLayout(jFrame2Layout);
            jFrame2Layout.setHorizontalGroup(
                jFrame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jFrame2Layout.createSequentialGroup()
                    .addGroup(jFrame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jFrame2Layout.createSequentialGroup()
                            .addGap(134, 134, 134)
                            .addComponent(jLabel5))
                        .addGroup(jFrame2Layout.createSequentialGroup()
                            .addGap(160, 160, 160)
                            .addComponent(jLabel6))
                        .addGroup(jFrame2Layout.createSequentialGroup()
                            .addGap(38, 38, 38)
                            .addGroup(jFrame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jFrame2Layout.createSequentialGroup()
                                    .addGroup(jFrame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jFrame2Layout.createSequentialGroup()
                                            .addComponent(jLabel15)
                                            .addGap(18, 18, 18)
                                            .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE))
                                        .addGroup(jFrame2Layout.createSequentialGroup()
                                            .addComponent(jLabel11)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addGap(64, 64, 64)
                                            .addComponent(jLabel14)
                                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                            .addGroup(jFrame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                                .addComponent(jButton3)
                                                .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))))
                                    .addGap(26, 26, 26)
                                    .addComponent(jLabel12)
                                    .addGap(18, 18, 18)
                                    .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 366, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGroup(jFrame2Layout.createSequentialGroup()
                            .addGap(38, 38, 38)
                            .addComponent(jLabel9)
                            .addGap(29, 29, 29)
                            .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(63, 63, 63)
                            .addGroup(jFrame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jFrame2Layout.createSequentialGroup()
                                    .addComponent(jLabel13)
                                    .addGap(18, 18, 18)
                                    .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jFrame2Layout.createSequentialGroup()
                                    .addComponent(jLabel10)
                                    .addGap(18, 18, 18)
                                    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                    .addContainerGap(196, Short.MAX_VALUE))
            );
            jFrame2Layout.setVerticalGroup(
                jFrame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jFrame2Layout.createSequentialGroup()
                    .addGap(11, 11, 11)
                    .addComponent(jLabel5)
                    .addGroup(jFrame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addGroup(jFrame2Layout.createSequentialGroup()
                            .addGap(40, 40, 40)
                            .addComponent(jLabel9))
                        .addGroup(jFrame2Layout.createSequentialGroup()
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(jFrame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel10)
                                .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addGap(36, 36, 36)
                    .addGroup(jFrame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(jFrame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel14)
                            .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel12)
                            .addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addComponent(jLabel11))
                    .addGap(32, 32, 32)
                    .addGroup(jFrame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel15)
                        .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel13)
                        .addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 42, Short.MAX_VALUE)
                    .addComponent(jButton3)
                    .addGap(20, 20, 20))
            );
    
            jFrame3.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            jFrame3.setTitle("Page2");
            jFrame3.setAutoRequestFocus(false);
            jFrame3.setBounds(new java.awt.Rectangle(0, 0, 0, 0));
            jFrame3.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
            jFrame3.setMinimumSize(new java.awt.Dimension(600, 400));
            jFrame3.setPreferredSize(new java.awt.Dimension(600, 400));
    
            jToggleButton1.setText("ok");
            jToggleButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jToggleButton1ActionPerformed(evt);
                }
            });
    
            jTable1.setModel(new javax.swing.table.DefaultTableModel(
                new Object [][] {
    
                },
                new String [] {
                    "name", "s_id", "address"
                }
            ));
            jScrollPane1.setViewportView(jTable1);
    
            javax.swing.GroupLayout jFrame3Layout = new javax.swing.GroupLayout(jFrame3.getContentPane());
            jFrame3.getContentPane().setLayout(jFrame3Layout);
            jFrame3Layout.setHorizontalGroup(
                jFrame3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jFrame3Layout.createSequentialGroup()
                    .addGap(76, 76, 76)
                    .addGroup(jFrame3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 366, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jToggleButton1))
                    .addContainerGap(158, Short.MAX_VALUE))
            );
            jFrame3Layout.setVerticalGroup(
                jFrame3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jFrame3Layout.createSequentialGroup()
                    .addGap(41, 41, 41)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 106, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 151, Short.MAX_VALUE)
                    .addComponent(jToggleButton1)
                    .addGap(79, 79, 79))
            );
    
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            setTitle("Page1");
            setBounds(new java.awt.Rectangle(0, 0, 0, 0));
            setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
            setIconImages(null);
    
            jLabel1.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
            jLabel1.setForeground(new java.awt.Color(0, 0, 255));
            jLabel1.setText("Welcome to UTS portal");
    
            jLabel2.setForeground(new java.awt.Color(0, 102, 204));
            jLabel2.setText("Main Menu");
    
            jLabel3.setText("Login First");
    
            buttonGroup1.add(jRadioButton1);
            jRadioButton1.setText("Administrator");
            jRadioButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jRadioButton1ActionPerformed(evt);
                }
            });
    
            buttonGroup1.add(jRadioButton2);
            jRadioButton2.setText("Operator");
            jRadioButton2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jRadioButton2ActionPerformed(evt);
                }
            });
    
            jButton1.setText("Submit");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
                }
            });
    
            jLabel8.setIcon(new javax.swing.ImageIcon("C:\\Users\\Administrator\\Desktop\\md-bg.jpg")); // NOI18N
            jLabel8.setText("jLabel8");
    
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                            .addContainerGap()
                            .addComponent(jButton1))
                        .addGroup(layout.createSequentialGroup()
                            .addGap(28, 28, 28)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel1)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(jLabel3)
                                    .addComponent(jLabel2))))
                        .addGroup(layout.createSequentialGroup()
                            .addContainerGap()
                            .addComponent(jRadioButton1))
                        .addGroup(layout.createSequentialGroup()
                            .addContainerGap()
                            .addComponent(jRadioButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 136, Short.MAX_VALUE)
                    .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 241, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(22, 22, 22))
            );
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 290, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(jLabel1)
                            .addGap(28, 28, 28)
                            .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(44, 44, 44)
                            .addComponent(jLabel3)
                            .addGap(39, 39, 39)
                            .addComponent(jRadioButton1)
                            .addGap(18, 18, 18)
                            .addComponent(jRadioButton2)
                            .addGap(26, 26, 26)
                            .addComponent(jButton1)))
                    .addContainerGap(34, Short.MAX_VALUE))
            );
    
            pack();
        }// </editor-fold>
    
        private void jRadioButton3ActionPerformed(java.awt.event.ActionEvent evt) {                                              
             
              // TODO add your handling code here:
        }                                             
    
        private void jRadioButton4ActionPerformed(java.awt.event.ActionEvent evt) {                                              
            // TODO add your handling code here:
        }                                             
    
        private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                         
            if(jRadioButton3.isSelected())
            {//this.setVisible(false);
                jFrame1.setVisible(false);
            jFrame2.setVisible(true);
           // jFrame2.setSize(600,400);
            
            //jFrame2.setLocationRelativeTo(this);
            //jFrame2.getContentPane().add(this);
    
                
            }
    
    // TODO add your handling code here:
        }                                        
    
        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
            this.setVisible(false);
            jFrame1.setVisible(true);
            
            
            // TODO add your handling code here:
        }                                        
    
        private void jRadioButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                              
            // TODO add your handling code here:
        }                                             
    
        private void jRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                              
            // TODO add your handling code here:
        }                                             
    
        private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {                                         
            
            jFrame2.setVisible(false);
            jFrame3.setVisible(true);
            //jFrame3.setSize(600,400);
            
            //jFrame3.setLocationRelativeTo(this);
            //jFrame3.getContentPane().add(this);
    
            
            // TODO add your handling code here:
        }                                        
    
        private void jTextField6ActionPerformed(java.awt.event.ActionEvent evt) {                                            
            // TODO add your handling code here:
        }                                           
    
        private void jTextField7ActionPerformed(java.awt.event.ActionEvent evt) {                                            
           // TODO add your handling code here:
        }                                           
    
        private void jTextField3ActionPerformed(java.awt.event.ActionEvent evt) {                                            
            // TODO add your handling code here:
        }                                           
    
        private void jToggleButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                               
           DefaultTableModel model=(DefaultTableModel)jTable1.getModel();
           try{
               
           Class.forName("oracle.jdbc.OracleDriver");
                  
           
                Connection con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","pal","pal");
                Statement stm=con.createStatement();
                
                ResultSet rs=stm.executeQuery("select * from pal where name="+jTextField1);
               
                while(rs.next())
                {  
                    String name=rs.getString("name");
                    String id=rs.getString("S_ID");
                    String add=rs.getString("address");
                   
                  model.addRow(new Object[]{name,id,add});
                }
                
                rs.close();
                stm.close();
                con.close();
                
           }
           catch(Exception e){
               //JOptionPane.showMessageDialog(this, "error in connectivity");
           e.printStackTrace();
           }
           
           
           
            
            // TODO add your handling code here:
        }                                              
    
        /**
         * @param args the command line arguments
         */
        public static void main(String args[]) {
            /*
             * Set the Nimbus look and feel
             */
            //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
            /*
             * If Nimbus (introduced in Java SE 6) is not available, stay with the
             * default look and feel. For details see
             * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
             */
            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(UtsUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (InstantiationException ex) {
                java.util.logging.Logger.getLogger(UtsUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (IllegalAccessException ex) {
                java.util.logging.Logger.getLogger(UtsUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (javax.swing.UnsupportedLookAndFeelException ex) {
                java.util.logging.Logger.getLogger(UtsUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            }
            //</editor-fold>
    
            /*
             * Create and display the form
             */
            java.awt.EventQueue.invokeLater(new Runnable() {
    
                public void run() {
                    new UtsUI().setVisible(true);
                }
            });
        }
        // Variables declaration - do not modify
        private javax.swing.ButtonGroup buttonGroup1;
        private javax.swing.JButton jButton1;
        private javax.swing.JButton jButton2;
        private javax.swing.JButton jButton3;
        private javax.swing.JFrame jFrame1;
        private javax.swing.JFrame jFrame2;
        private javax.swing.JFrame jFrame3;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JLabel jLabel10;
        private javax.swing.JLabel jLabel11;
        private javax.swing.JLabel jLabel12;
        private javax.swing.JLabel jLabel13;
        private javax.swing.JLabel jLabel14;
        private javax.swing.JLabel jLabel15;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JLabel jLabel3;
        private javax.swing.JLabel jLabel4;
        private javax.swing.JLabel jLabel5;
        private javax.swing.JLabel jLabel6;
        private javax.swing.JLabel jLabel8;
        private javax.swing.JLabel jLabel9;
        private javax.swing.JRadioButton jRadioButton1;
        private javax.swing.JRadioButton jRadioButton2;
        private javax.swing.JRadioButton jRadioButton3;
        private javax.swing.JRadioButton jRadioButton4;
        private javax.swing.JScrollPane jScrollPane1;
        private javax.swing.JScrollPane jScrollPane2;
        private javax.swing.JTable jTable1;
        private javax.swing.JTable jTable2;
        private javax.swing.JTextField jTextField1;
        private javax.swing.JTextField jTextField2;
        private javax.swing.JTextField jTextField3;
        private javax.swing.JTextField jTextField4;
        private javax.swing.JTextField jTextField5;
        private javax.swing.JTextField jTextField6;
        private javax.swing.JTextField jTextField7;
        private javax.swing.JToggleButton jToggleButton1;
        // End of variables declaration
    }
    
    


    while going from jframe1 to jframe2 its taking some seconds.
  5. In Topic: unable to connect to database in net beans

    Posted 28 Jul 2012

    i have already make a databse with driver "oracle:odbc:Oracledriver"

    url"jdbc:oracle:thin:@localhost:1521:XE"

    having 3 columns- name,id,address

    thanks... but may i know how it helped me.

    but after pressing the button, i am getting the data again and again !!!

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

pallavi11 hasn't added any friends yet.

Comments

pallavi11 has no profile comments yet. Why not say hello?