Results 1 to 13 of 13
Like Tree2Likes
  • 1 Post By DarrylBurke
  • 1 Post By DarrylBurke

Thread: Gui doesn't work on browser :S

  1. #1
    Ehoxha is offline Member
    Join Date
    Sep 2012
    Posts
    6
    Rep Power
    0

    Post Gui doesn't work on browser :S

    I created an Gui and my database populated when i write on textfield.
    I used JDBC inside try-catch block to connection with database.
    When i open GUI with browser it doesn't work. Where's problem?

    Would i create server-client architecture to apply application on browser or would i create an applet application(not GUI--JFrame class)?

  2. #2
    Ehoxha is offline Member
    Join Date
    Sep 2012
    Posts
    6
    Rep Power
    0

    Default Re: Gui doesn't work on browser :S

    Here are gui's image and java code :
    Gui doesn't work on browser :S-gui.png

    Java Code:
    import java.math.BigDecimal;
    import java.sql.*;
    import javax.swing.*;
    import java.sql.ResultSet;
    import java.sql.PreparedStatement;
    
    
    public class vendoskoordinatat extends javax.swing.JFrame {
     
        Connection conn = null; 
        PreparedStatement pst = null; 
    ResultSet rs = null;
       Statement s =null; 
      
        
    
        /** Creates new form vendoskoordinatat */
        public vendoskoordinatat() {
            initComponents();
            
              butonatgk.add(nbutongk);
              butonatgk.add(sbutongk);
              butonatutm.add(nbutonutm);
              butonatutm.add(sbutonutm);
            
        }
    
        /** 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">//GEN-BEGIN:initComponents
        private void initComponents() {
    
            butonatgk = new javax.swing.ButtonGroup();
            butonatutm = new javax.swing.ButtonGroup();
            jPanel1 = new javax.swing.JPanel();
            jLabel1 = new javax.swing.JLabel();
            jLabel2 = new javax.swing.JLabel();
            jLabel3 = new javax.swing.JLabel();
            txtlatdecimale = new javax.swing.JTextField();
            txtlongdecimale = new javax.swing.JTextField();
            cmdresetdecimale = new javax.swing.JButton();
            cmdvendosdecimale = new javax.swing.JButton();
            jComboBox1 = new javax.swing.JComboBox();
            cmddecimaltodms = new javax.swing.JButton();
            cmddecimaltoutm = new javax.swing.JButton();
            jPanel3 = new javax.swing.JPanel();
            jLabel9 = new javax.swing.JLabel();
            jComboBox3 = new javax.swing.JComboBox();
            jLabel10 = new javax.swing.JLabel();
            jLabel11 = new javax.swing.JLabel();
            txtfigradedms = new javax.swing.JTextField();
            jLabel12 = new javax.swing.JLabel();
            txtfimindms = new javax.swing.JTextField();
            jLabel13 = new javax.swing.JLabel();
            jLabel14 = new javax.swing.JLabel();
            txtfisekdms = new javax.swing.JTextField();
            jLabel15 = new javax.swing.JLabel();
            txtlandagradedms = new javax.swing.JTextField();
            jLabel16 = new javax.swing.JLabel();
            txtlandamindms = new javax.swing.JTextField();
            jLabel17 = new javax.swing.JLabel();
            txtlandasekdms = new javax.swing.JTextField();
            jLabel18 = new javax.swing.JLabel();
            cmdresetdms = new javax.swing.JButton();
            cmddmstodecimal = new javax.swing.JButton();
            cmddmstoutm = new javax.swing.JButton();
            cmdvendosdms = new javax.swing.JButton();
            jPanel2 = new javax.swing.JPanel();
            jLabel4 = new javax.swing.JLabel();
            jComboBox2 = new javax.swing.JComboBox();
            jLabel5 = new javax.swing.JLabel();
            jLabel6 = new javax.swing.JLabel();
            txtlatgk = new javax.swing.JTextField();
            txtlonggk = new javax.swing.JTextField();
            cmdvendosgk = new javax.swing.JButton();
            cmdresetgk = new javax.swing.JButton();
            cmdgktoutm = new javax.swing.JButton();
            jLabel7 = new javax.swing.JLabel();
            jLabel8 = new javax.swing.JLabel();
            txtzonagk = new javax.swing.JTextField();
            nbutongk = new javax.swing.JRadioButton();
            sbutongk = new javax.swing.JRadioButton();
            jPanel4 = new javax.swing.JPanel();
            jLabel19 = new javax.swing.JLabel();
            jComboBox4 = new javax.swing.JComboBox();
            jLabel20 = new javax.swing.JLabel();
            jLabel21 = new javax.swing.JLabel();
            txtlatutm = new javax.swing.JTextField();
            txtlongutm = new javax.swing.JTextField();
            jLabel22 = new javax.swing.JLabel();
            txtzonautm = new javax.swing.JTextField();
            jLabel23 = new javax.swing.JLabel();
            nbutonutm = new javax.swing.JRadioButton();
            sbutonutm = new javax.swing.JRadioButton();
            cmdresetutm = new javax.swing.JButton();
            jButton1 = new javax.swing.JButton();
            cmdvendosutm = new javax.swing.JButton();
            cmdutmtodecimale = new javax.swing.JButton();
            cmdutmtodms = new javax.swing.JButton();
    
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            setTitle("GUI - Graphical User Interface!");
            setBackground(new java.awt.Color(204, 204, 255));
            setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
            addWindowListener(new java.awt.event.WindowAdapter() {
                public void windowOpened(java.awt.event.WindowEvent evt) {
                    formWindowOpened(evt);
                }
            });
    
            jPanel1.setBackground(new java.awt.Color(237, 237, 255));
            jPanel1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
    
            jLabel1.setBackground(new java.awt.Color(0, 0, 0));
            jLabel1.setFont(new java.awt.Font("Vivaldi", 1, 24));
            jLabel1.setForeground(javax.swing.UIManager.getDefaults().getColor("Button.disabledForeground"));
            jLabel1.setText("Koordinata gjeografike decimale!");
    
            jLabel2.setFont(new java.awt.Font("Bookman Old Style", 0, 14));
            jLabel2.setText("Latitude :");
    
            jLabel3.setFont(new java.awt.Font("Bookman Old Style", 0, 14));
            jLabel3.setText("Longitude :");
    
            cmdresetdecimale.setFont(new java.awt.Font("Book Antiqua", 0, 14));
            cmdresetdecimale.setText("Reset");
            cmdresetdecimale.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    cmdresetdecimaleActionPerformed(evt);
                }
            });
    
            cmdvendosdecimale.setFont(new java.awt.Font("Book Antiqua", 0, 14));
            cmdvendosdecimale.setText("Set coordinates");
            cmdvendosdecimale.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    cmdvendosdecimaleActionPerformed(evt);
                }
            });
    
            jComboBox1.setFont(new java.awt.Font("Bookman Old Style", 0, 12));
            jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Viti i matjes", "2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "2010", "2011", "2012" }));
    
            cmddecimaltodms.setFont(new java.awt.Font("Book Antiqua", 0, 13));
            cmddecimaltodms.setText("Konverto ne DMS    >> ");
            cmddecimaltodms.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    cmddecimaltodmsActionPerformed(evt);
                }
            });
    
            cmddecimaltoutm.setFont(new java.awt.Font("Book Antiqua", 0, 13));
            cmddecimaltoutm.setText("Konverto ne UTM   >>");
            cmddecimaltoutm.addMouseListener(new java.awt.event.MouseAdapter() {
                public void mouseClicked(java.awt.event.MouseEvent evt) {
                    cmddecimaltoutmMouseClicked(evt);
                }
            });
    
            javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
            jPanel1.setLayout(jPanel1Layout);
            jPanel1Layout.setHorizontalGroup(
                jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel1Layout.createSequentialGroup()
                    .addGap(10, 10, 10)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addGap(65, 65, 65)
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(jLabel2)
                                        .addGap(31, 31, 31))
                                    .addGroup(jPanel1Layout.createSequentialGroup()
                                        .addComponent(jLabel3)
                                        .addGap(18, 18, 18)))
                                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(txtlatdecimale, javax.swing.GroupLayout.DEFAULT_SIZE, 181, Short.MAX_VALUE)
                                    .addComponent(txtlongdecimale))))
                        .addComponent(jLabel1))
                    .addGap(18, 18, 18)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(cmddecimaltodms)
                        .addComponent(cmddecimaltoutm, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap())
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                    .addContainerGap(277, Short.MAX_VALUE)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addGap(10, 10, 10)
                            .addComponent(cmdresetdecimale, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addComponent(cmdvendosdecimale, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(139, 139, 139))
            );
            jPanel1Layout.setVerticalGroup(
                jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel1Layout.createSequentialGroup()
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addGap(58, 58, 58)
                            .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                            .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(cmddecimaltodms)
                                .addComponent(jLabel1))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(cmddecimaltoutm)))
                    .addGap(14, 14, 14)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel2)
                        .addComponent(txtlatdecimale, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(txtlongdecimale, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel3))
                    .addGap(18, 18, 18)
                    .addComponent(cmdvendosdecimale)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(cmdresetdecimale)
                    .addContainerGap(22, Short.MAX_VALUE))
            );
    
            jPanel3.setBackground(new java.awt.Color(237, 237, 255));
            jPanel3.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
    
            jLabel9.setFont(new java.awt.Font("Vivaldi", 1, 24));
            jLabel9.setForeground(new java.awt.Color(109, 109, 109));
            jLabel9.setText("Koordinata Degrees-Minutes-Seconds!");
    
            jComboBox3.setFont(new java.awt.Font("Bookman Old Style", 0, 12));
            jComboBox3.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Viti i matjes", "2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "2010", "2011", "2012" }));
    
            jLabel10.setFont(new java.awt.Font("Bookman Old Style", 0, 14));
            jLabel10.setText("Latitude (phi) :");
    
            jLabel11.setFont(new java.awt.Font("Bookman Old Style", 0, 14));
            jLabel11.setText("Longitude (lambda) :");
    
            jLabel12.setFont(new java.awt.Font("Tahoma", 0, 24));
            jLabel12.setText("°");
    
            jLabel14.setFont(new java.awt.Font("Tahoma", 0, 24));
            jLabel14.setText("'");
    
            jLabel15.setFont(new java.awt.Font("Tahoma", 0, 24));
            jLabel15.setText("''");
    
            jLabel16.setFont(new java.awt.Font("Tahoma", 0, 24));
            jLabel16.setText("°");
    
            jLabel17.setFont(new java.awt.Font("Tahoma", 0, 24));
            jLabel17.setText("'");
    
            jLabel18.setFont(new java.awt.Font("Tahoma", 0, 24));
            jLabel18.setText("''");
    
            cmdresetdms.setFont(new java.awt.Font("Book Antiqua", 0, 14));
            cmdresetdms.setText("Reset");
            cmdresetdms.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    cmdresetdmsActionPerformed(evt);
                }
            });
    
            cmddmstodecimal.setFont(new java.awt.Font("Book Antiqua", 0, 13));
            cmddmstodecimal.setText("Konverto ne DECIMALE   >>");
    
            cmddmstoutm.setFont(new java.awt.Font("Book Antiqua", 0, 13));
            cmddmstoutm.setText("Konverto ne UTM      >>");
    
            cmdvendosdms.setFont(new java.awt.Font("Book Antiqua", 0, 14));
            cmdvendosdms.setText("Set coordinates");
            cmdvendosdms.addMouseListener(new java.awt.event.MouseAdapter() {
                public void mouseClicked(java.awt.event.MouseEvent evt) {
                    cmdvendosdmsMouseClicked(evt);
                }
            });
    
            javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
            jPanel3.setLayout(jPanel3Layout);
            jPanel3Layout.setHorizontalGroup(
                jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel3Layout.createSequentialGroup()
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel3Layout.createSequentialGroup()
                            .addGap(52, 52, 52)
                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel11)
                                .addComponent(jLabel10))
                            .addGap(27, 27, 27)
                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(txtlandagradedms)
                                .addComponent(txtfigradedms, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addGroup(jPanel3Layout.createSequentialGroup()
                                    .addComponent(jLabel16)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(txtlandamindms))
                                .addGroup(jPanel3Layout.createSequentialGroup()
                                    .addComponent(jLabel12)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(txtfimindms, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel17)
                                .addComponent(jLabel14, javax.swing.GroupLayout.PREFERRED_SIZE, 13, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(txtlandasekdms)
                                .addComponent(txtfisekdms, javax.swing.GroupLayout.DEFAULT_SIZE, 93, Short.MAX_VALUE))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel15, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel18))
                            .addGap(65, 65, 65)
                            .addComponent(jLabel13))
                        .addGroup(jPanel3Layout.createSequentialGroup()
                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jPanel3Layout.createSequentialGroup()
                                    .addGap(19, 19, 19)
                                    .addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel3Layout.createSequentialGroup()
                                    .addGap(52, 52, 52)
                                    .addComponent(jLabel9)))
                            .addGap(18, 18, 18)
                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(cmddmstoutm, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(cmddmstodecimal, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                    .addContainerGap())
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                    .addContainerGap(363, Short.MAX_VALUE)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                            .addGap(10, 10, 10)
                            .addComponent(cmdresetdms, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGap(200, 200, 200))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                            .addComponent(cmdvendosdms)
                            .addGap(190, 190, 190))))
            );
            jPanel3Layout.setVerticalGroup(
                jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel3Layout.createSequentialGroup()
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                            .addContainerGap()
                            .addComponent(jLabel9)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jPanel3Layout.createSequentialGroup()
                            .addGap(20, 20, 20)
                            .addComponent(cmddmstodecimal)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(cmddmstoutm)
                            .addGap(4, 4, 4)))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addGroup(jPanel3Layout.createSequentialGroup()
                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(txtfigradedms, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel12)
                                .addComponent(txtfimindms, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel14)
                                .addComponent(txtfisekdms, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel15))
                            .addGap(10, 10, 10))
                        .addComponent(jLabel10))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(txtlandamindms, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel11)
                        .addComponent(txtlandagradedms, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel16)
                        .addComponent(jLabel17)
                        .addComponent(txtlandasekdms, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jLabel18))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(cmdvendosdms)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(cmdresetdms)
                    .addGap(32, 32, 32)
                    .addComponent(jLabel13)
                    .addGap(122, 122, 122))
            );
    
            jPanel2.setBackground(new java.awt.Color(237, 237, 255));
            jPanel2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
    
            jLabel4.setFont(new java.awt.Font("Vivaldi", 1, 24));
            jLabel4.setForeground(new java.awt.Color(109, 109, 109));
            jLabel4.setText("Koordinata Gauss-Krueger!");
    
            jComboBox2.setFont(new java.awt.Font("Bookman Old Style", 0, 12));
            jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Viti i matjes", "2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "2010", "2011", "2012" }));
    
            jLabel5.setFont(new java.awt.Font("Bookman Old Style", 0, 14));
            jLabel5.setText("Latitude (y) :");
    
            jLabel6.setFont(new java.awt.Font("Bookman Old Style", 0, 14));
            jLabel6.setText("Longitude (x) :");
    
            cmdvendosgk.setFont(new java.awt.Font("Book Antiqua", 0, 14));
            cmdvendosgk.setText("Set coordinates");
            cmdvendosgk.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    cmdvendosgkActionPerformed(evt);
                }
            });
    
            cmdresetgk.setFont(new java.awt.Font("Book Antiqua", 0, 14));
            cmdresetgk.setText("Reset");
            cmdresetgk.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    cmdresetgkActionPerformed(evt);
                }
            });
    
            cmdgktoutm.setFont(new java.awt.Font("Book Antiqua", 0, 13));
            cmdgktoutm.setText("Konverto ne UTM   >>");
            cmdgktoutm.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    cmdgktoutmActionPerformed(evt);
                }
            });
    
            jLabel7.setFont(new java.awt.Font("Bookman Old Style", 0, 14));
            jLabel7.setText("Zona : ");
    
            jLabel8.setFont(new java.awt.Font("Bookman Old Style", 0, 14));
            jLabel8.setText("Hemisfera :");
    
            nbutongk.setFont(new java.awt.Font("Bookman Old Style", 0, 12));
            nbutongk.setText("N (Nord)");
    
            sbutongk.setFont(new java.awt.Font("Bookman Old Style", 0, 12));
            sbutongk.setText("S (Sud)");
    
            javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
            jPanel2.setLayout(jPanel2Layout);
            jPanel2Layout.setHorizontalGroup(
                jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel2Layout.createSequentialGroup()
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel2Layout.createSequentialGroup()
                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jPanel2Layout.createSequentialGroup()
                                    .addGap(24, 24, 24)
                                    .addComponent(jLabel4))
                                .addGroup(jPanel2Layout.createSequentialGroup()
                                    .addContainerGap()
                                    .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGap(33, 33, 33)
                            .addComponent(cmdgktoutm))
                        .addGroup(jPanel2Layout.createSequentialGroup()
                            .addGap(68, 68, 68)
                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel5)
                                .addComponent(jLabel6)
                                .addComponent(jLabel7)
                                .addComponent(jLabel8))
                            .addGap(6, 6, 6)
                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jPanel2Layout.createSequentialGroup()
                                    .addGap(10, 10, 10)
                                    .addComponent(cmdresetgk, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel2Layout.createSequentialGroup()
                                    .addGap(20, 20, 20)
                                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addGroup(jPanel2Layout.createSequentialGroup()
                                            .addComponent(nbutongk)
                                            .addGap(18, 18, 18)
                                            .addComponent(sbutongk))
                                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(txtlonggk)
                                            .addComponent(txtlatgk, javax.swing.GroupLayout.PREFERRED_SIZE, 196, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(txtzonagk, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE))))
                                .addComponent(cmdvendosgk))))
                    .addContainerGap(65, Short.MAX_VALUE))
            );
            jPanel2Layout.setVerticalGroup(
                jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel2Layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jLabel4)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel2Layout.createSequentialGroup()
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(cmdgktoutm))
                        .addGroup(jPanel2Layout.createSequentialGroup()
                            .addGap(28, 28, 28)
                            .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(18, 18, 18)
                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel5)
                                .addComponent(txtlatgk, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGap(12, 12, 12)
                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel6)
                                .addComponent(txtlonggk, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel7)
                                .addComponent(txtzonagk, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel8)
                                .addComponent(nbutongk)
                                .addComponent(sbutongk))))
                    .addGap(12, 12, 12)
                    .addComponent(cmdvendosgk)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(cmdresetgk)
                    .addContainerGap(21, Short.MAX_VALUE))
            );
    
            jPanel4.setBackground(new java.awt.Color(237, 237, 255));
            jPanel4.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
    
            jLabel19.setFont(new java.awt.Font("Vivaldi", 1, 24));
            jLabel19.setForeground(new java.awt.Color(109, 109, 109));
            jLabel19.setText("Koordinata Universal Trasvesal Mercator!");
    
            jComboBox4.setFont(new java.awt.Font("Bookman Old Style", 0, 12));
            jComboBox4.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Viti i matjes", "2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007", "2008", "2009", "2010", "2011", "2012" }));
    
            jLabel20.setFont(new java.awt.Font("Bookman Old Style", 0, 14));
            jLabel20.setText("y (Northing) :");
    
            jLabel21.setFont(new java.awt.Font("Bookman Old Style", 0, 14));
            jLabel21.setText("x (Easting) :");
    
            jLabel22.setFont(new java.awt.Font("Bookman Old Style", 0, 14));
            jLabel22.setText("Zona :");
    
            jLabel23.setFont(new java.awt.Font("Bookman Old Style", 0, 14));
            jLabel23.setText("Hemisfera : ");
    
            nbutonutm.setFont(new java.awt.Font("Bookman Old Style", 0, 12));
            nbutonutm.setText("N (Nord)");
    
            sbutonutm.setFont(new java.awt.Font("Bookman Old Style", 0, 12));
            sbutonutm.setText("S (Sud)");
    
            cmdresetutm.setFont(new java.awt.Font("Book Antiqua", 0, 14));
            cmdresetutm.setText("Reset");
    
            jButton1.setText("jButton1");
    
            cmdvendosutm.setFont(new java.awt.Font("Book Antiqua", 0, 14));
            cmdvendosutm.setText("Set coordinates");
            cmdvendosutm.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    cmdvendosutmActionPerformed(evt);
                }
            });
    
            cmdutmtodecimale.setFont(new java.awt.Font("Book Antiqua", 0, 13));
            cmdutmtodecimale.setText("Konverto ne DECIMALE    >>");
            cmdutmtodecimale.addMouseListener(new java.awt.event.MouseAdapter() {
                public void mouseClicked(java.awt.event.MouseEvent evt) {
                    cmdutmtodecimaleMouseClicked(evt);
                }
            });
    
            cmdutmtodms.setFont(new java.awt.Font("Book Antiqua", 0, 13));
            cmdutmtodms.setText("Konverto ne DMS    >>");
            cmdutmtodms.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    cmdutmtodmsActionPerformed(evt);
                }
            });
    
            javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
            jPanel4.setLayout(jPanel4Layout);
            jPanel4Layout.setHorizontalGroup(
                jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel4Layout.createSequentialGroup()
                    .addGap(25, 25, 25)
                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(jPanel4Layout.createSequentialGroup()
                            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel21)
                                .addComponent(jLabel20)
                                .addComponent(jLabel22)
                                .addComponent(jLabel23))
                            .addGap(43, 43, 43)
                            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(txtlongutm, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(txtlatutm, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 240, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel4Layout.createSequentialGroup()
                                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                        .addComponent(txtzonautm, javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(nbutonutm, javax.swing.GroupLayout.Alignment.LEADING))
                                    .addGap(18, 18, 18)
                                    .addComponent(sbutonutm))))
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel19)
                            .addComponent(jComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(cmdutmtodms, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(cmdutmtodecimale, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGap(50, 50, 50))
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                    .addContainerGap(309, Short.MAX_VALUE)
                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(jPanel4Layout.createSequentialGroup()
                            .addComponent(cmdresetutm, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(31, 31, 31))
                        .addComponent(cmdvendosutm, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(211, 211, 211))
            );
            jPanel4Layout.setVerticalGroup(
                jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel4Layout.createSequentialGroup()
                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel4Layout.createSequentialGroup()
                            .addContainerGap()
                            .addComponent(jLabel19)
                            .addGap(18, 18, 18)
                            .addComponent(jComboBox4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(26, 26, 26)
                            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel20)
                                .addComponent(txtlatutm, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel21)
                                .addComponent(txtlongutm, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel22)
                                .addComponent(txtzonautm, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel23)
                                .addComponent(nbutonutm)
                                .addComponent(sbutonutm)))
                        .addGroup(jPanel4Layout.createSequentialGroup()
                            .addGap(40, 40, 40)
                            .addComponent(cmdutmtodecimale)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(cmdutmtodms)))
                    .addGap(18, 18, 18)
                    .addComponent(cmdvendosutm)
                    .addGap(15, 15, 15)
                    .addComponent(cmdresetutm)
                    .addContainerGap(26, Short.MAX_VALUE))
            );
    
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(29, 29, 29)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(161, 161, 161))
            );
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 246, Short.MAX_VALUE))
                    .addGap(18, 18, 18)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGap(182, 182, 182))
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addContainerGap())))
            );
    
            pack();
        }// </editor-fold>//GEN-END:initComponents
    
    private void cmdresetdecimaleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdresetdecimaleActionPerformed
    // TODO add your handling code here:
         txtlatdecimale.setText("");
        txtlongdecimale.setText("");
    }//GEN-LAST:event_cmdresetdecimaleActionPerformed
    
    private void cmdvendosdecimaleActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdvendosdecimaleActionPerformed
    // TODO add your handling code here:
       
         try { 
             
            pst=conn.prepareStatement("SELECT nr FROM `vijabregore`.`koordfillestare` ORDER BY nr ASC");
            rs = pst.executeQuery();
    	int num = rs.getRow();   
            rs.close();
    
                if (num ==1)
                    rs.close();
    		pst.close();
    		pst = conn.prepareStatement("SELECT * FROM `vijabregore`.`koordfillestare` ORDER BY nr ASC");
    		rs =pst.executeQuery();
    		rs.afterLast();
    		rs.previous();
    		int nr = rs.getInt("nr");
    		int shtonje = nr+1;
    			pst.close();
                	pst=conn.prepareStatement("INSERT INTO `vijabregore`.`koordfillestare` (`nr`) VALUES(?)");
    		pst.setInt(1,shtonje);
    		pst.executeUpdate();
    		pst.close();
                  
    		 pst =conn.prepareStatement("INSERT INTO `vijabregore`.`gjeodecimale`(`fi`,`landa`,`kf_nr`)VALUES( ?,?,?)");
                
                   pst.setString (1, txtlatdecimale.getText());
                     pst.setString (2, txtlongdecimale.getText());
                     pst.setInt(3,shtonje);
                                       if (Integer.parseInt(this.txtlatdecimale.getText()) > 90 ||Integer.parseInt(this.txtlongdecimale.getText())< -90 ){
             JOptionPane.showMessageDialog(null, "The latitude you entered is out of range.  " +
                       "Please enter a number in the range [-90, 90].");
                  pst.close();
                       }
          if (Integer.parseInt(this.txtlongdecimale.getText()) > 90 ||Integer.parseInt(this.txtlongdecimale.getText())< -90 ){
             JOptionPane.showMessageDialog(null, "The longitude you entered is out of range.  " +
                       "Please enter a number in the range [-180, 180).");
             pst.close();
          }
    
    			pst.executeUpdate();
                            
    	rs.close();
    	pst.close();         
           JOptionPane.showMessageDialog(null, "Decimal geographic coordinate saved!");
                
    } catch (Exception e){
           JOptionPane.showMessageDialog(null, e); 
           
    }                                     
    }//GEN-LAST:event_cmdvendosdecimaleActionPerformed
    
    private void cmdresetdmsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdresetdmsActionPerformed
    // TODO add your handling code here:
         txtfigradedms.setText("");
         txtfimindms.setText("");
         txtfisekdms.setText("");
         txtlandagradedms.setText("");
         txtlandamindms.setText("");
         txtlandasekdms.setText("");
    }//GEN-LAST:event_cmdresetdmsActionPerformed
    
    private void cmdvendosdmsMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cmdvendosdmsMouseClicked
    // TODO add your handling code here:
         try { 
                     
      
         pst=conn.prepareStatement("SELECT nr FROM `vijabregore`.`koordfillestare` ORDER BY nr ASC");
    
          rs = pst.executeQuery();
    	int num =  rs.getRow();  
                  
                if (num ==1)
    		rs.close();
    		pst.close();
    		pst = conn.prepareStatement("SELECT * FROM `vijabregore`.`koordfillestare` ORDER BY nr ASC");
    		rs =pst.executeQuery();
    		rs.afterLast();
    		rs.previous();
    		int nr = rs.getInt("nr");
    		int shtonje = nr+1;
    		
    	pst.close();
                	pst=conn.prepareStatement("INSERT INTO `vijabregore`.`koordfillestare` (`nr`) VALUES(?)");
    		pst.setInt(1,shtonje);
    		pst.executeUpdate();
    		pst.close();
                    
                      if (Integer.parseInt(this.txtfigradedms.getText()) > 90 ||Integer.parseInt(this.txtfigradedms.getText())< -90 ){
             JOptionPane.showMessageDialog(null, "The latitude's degree you entered is out of range.  " +
                       "Please enter a number in the range [-90, 90].");
                               pst.close(); }
                      if (Integer.parseInt(this.txtfimindms.getText()) > 60 ||Integer.parseInt(this.txtfimindms.getText())< 0 ){
             JOptionPane.showMessageDialog(null, "The latitude's minutes you entered are out of range.  " +
                       "Please enter a number in the range [0, 60].");
                             pst.close();   }
                       if (Integer.parseInt(this.txtfisekdms.getText()) > 60 ||Integer.parseInt(this.txtfisekdms.getText())< 0 ){
             JOptionPane.showMessageDialog(null, "The latitude's seconds you entered are out of range.  " +
                       "Please enter a number in the range [0, 60].");
                             pst.close();   }
                      
                      
          if (Integer.parseInt(this.txtlandagradedms.getText()) > 180 ||Integer.parseInt(this.txtlandagradedms.getText())< -180 ){
             JOptionPane.showMessageDialog(null, "The longitude's degree you entered is out of range.  " +
                       "Please enter a number in the range [-180, 180).");
             pst.close(); }
          
           if (Integer.parseInt(this.txtlandamindms.getText()) > 60 ||Integer.parseInt(this.txtlandamindms.getText())< 0 ){
             JOptionPane.showMessageDialog(null, "The longitude's minutes you entered are out of range.  " +
                       "Please enter a number in the range [0, 60].");
                             pst.close();   }
                       if (Integer.parseInt(this.txtlandasekdms.getText()) > 60 ||Integer.parseInt(this.txtlandasekdms.getText())< 0 ){
             JOptionPane.showMessageDialog(null, "The longitude's seconds you entered are out of range.  " +
                       "Please enter a number in the range [0, 60].");
                             pst.close();   }
    
    		pst =conn.prepareStatement("INSERT INTO `vijabregore`.`koordperfundimtare`(`fiGrade`,`fiMin`,`fiSek`,`landaGrade`,`landaMin`,`landaSek`,`kf_nr`)VALUES(?,?,?,?,?,?,? )");
    		 pst.setString(1, txtfigradedms.getText());
                   pst.setString(2, txtfimindms.getText());
                  pst.setString(3, txtfisekdms.getText());
                    pst.setString(4, txtlandagradedms.getText());
                       pst.setString(5, txtlandamindms.getText());
                        pst.setString(6, txtlandasekdms.getText());
    		pst.setInt(7,shtonje);
    		pst.executeUpdate();
    
    	
    	rs.close();
    	pst.close();
    	
         JOptionPane.showMessageDialog(null, "Degrees-Minutes-Seconds coordinate saved!");
    } catch (Exception e){
         JOptionPane.showMessageDialog(null, e); 
    }
    }//GEN-LAST:event_cmdvendosdmsMouseClicked
    Last edited by Norm; 09-08-2012 at 04:20 PM. Reason: changed quote to ciode

  3. #3
    Ehoxha is offline Member
    Join Date
    Sep 2012
    Posts
    6
    Rep Power
    0

    Default Re: Gui doesn't work on browser :S

    java code continnuing :

    private void cmdvendosgkActionPerformed(java.awt.event.ActionEv ent evt) {//GEN-FIRST:event_cmdvendosgkActionPerformed
    // TODO add your handling code here:
    try {

    pst=conn.prepareStatement("SELECT nr FROM `vijabregore`.`koordfillestare` ORDER BY nr ASC");

    rs = pst.executeQuery();
    int num = rs.getRow();
    rs.close();

    if (num ==1)
    rs.close();
    pst.close();
    pst = conn.prepareStatement("SELECT * FROM `vijabregore`.`koordfillestare` ORDER BY nr ASC");
    rs =pst.executeQuery();
    rs.afterLast();
    rs.previous();
    int nr = rs.getInt("nr");
    int shtonje = nr+1;

    pst.close();
    pst=conn.prepareStatement("INSERT INTO `vijabregore`.`koordfillestare` (`nr`) VALUES(?)");
    pst.setInt(1,shtonje);
    pst.executeUpdate();
    pst.close();
    pst =conn.prepareStatement("INSERT INTO `vijabregore`.`gausskrueger`(`y`,`x`,`hemisfera`,` zona`,`kf_nr`)VALUES(?,?,?,?,? )");
    pst.setString(1, txtlatgk.getText());
    pst.setString(2, txtlonggk.getText());
    pst.setString(3, txtzonagk.getText());
    if (nbutongk.isSelected()){
    pst.setString(3, "N");
    } else if (sbutongk.isSelected()){
    pst.setString(3, "S");
    }
    pst.setString(4, txtzonagk.getText());
    pst.setInt(5,shtonje);
    pst.executeUpdate();


    rs.close();
    pst.close();
    //conn.close();
    JOptionPane.showMessageDialog(null, "Gauss Krueger coordinate saved!");
    } catch (Exception e){
    JOptionPane.showMessageDialog(null, e);


    }
    }//GEN-LAST:event_cmdvendosgkActionPerformed

    private void cmdresetgkActionPerformed(java.awt.event.ActionEve nt evt) {//GEN-FIRST:event_cmdresetgkActionPerformed
    // TODO add your handling code here:
    txtlatgk.setText("");
    txtlonggk.setText("");
    txtzonagk.setText("");
    }//GEN-LAST:event_cmdresetgkActionPerformed

    private void cmdvendosutmActionPerformed(java.awt.event.ActionE vent evt) {//GEN-FIRST:event_cmdvendosutmActionPerformed
    // TODO add your handling code here:
    try {


    pst=conn.prepareStatement("SELECT nr FROM `vijabregore`.`koordfillestare` ORDER BY nr ASC");

    rs = pst.executeQuery();
    int num = rs.getRow();

    rs.close();

    // if (num ==1)
    rs.close();
    pst.close();
    pst = conn.prepareStatement("SELECT * FROM `vijabregore`.`koordfillestare` ORDER BY nr ASC");
    rs =pst.executeQuery();
    rs.afterLast();
    rs.previous();
    int nr = rs.getInt("nr");
    int shtonje = nr+1;

    pst.close();
    pst=conn.prepareStatement("INSERT INTO `vijabregore`.`koordfillestare` (`nr`) VALUES(?)");
    pst.setInt(1,shtonje);
    pst.executeUpdate();
    pst.close();
    pst =conn.prepareStatement("INSERT INTO `vijabregore`.`utm`(`y`,`x`,`hemisfera`,`zona`)VAL UES(?,?,?,?)");
    pst.setString(1, txtlatutm.getText());
    pst.setString(2, txtlongutm.getText());

    if (nbutonutm.isSelected()){
    pst.setString(3, "N");
    } else if (sbutonutm.isSelected()){
    pst.setString(3, "S");
    }
    pst.setString(4, txtzonautm.getText());
    // pst.setString(4, txtzonagkruegger.getText());

    pst.executeUpdate();


    rs.close();
    pst.close();

    JOptionPane.showMessageDialog(null, "Saved");
    } catch (Exception e){
    JOptionPane.showMessageDialog(null, e);


    }
    }//GEN-LAST:event_cmdvendosutmActionPerformed

    private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
    // TODO add your handling code here:
    try{
    Class.forName("com.mysql.jdbc.Driver");
    conn = DriverManager.getConnection("jdbc:mysql://localhost/vijabregore", "root", "");
    JOptionPane.showMessageDialog(null, "Lidhja me databazen u krye!" );

    }catch (Exception e){
    JOptionPane.showMessageDialog(null, e);

    }
    }//GEN-LAST:event_formWindowOpened

    private void cmdgktoutmActionPerformed(java.awt.event.ActionEve nt evt) {//GEN-FIRST:event_cmdgktoutmActionPerformed
    // TODO add your handling code here:

    int E, latgk, longk, N, zonnagk, zonautm;
    double ko = 0.9996;
    try {

    latgk = Integer.parseInt(this.txtlonggk.getText());
    int ky = 500000;
    E = (int) (latgk*ko + ky);
    this.txtlatutm.setText( "" + E);
    }catch (Exception e){
    JOptionPane.showMessageDialog(null, "Fut koordinaten e sakte ne formen: 4345432.345");
    return;
    }



    try{
    longk = Integer.parseInt(this.txtlatgk.getText());

    if (nbutongk.isSelected()){
    int kx= 0;
    N = (int) (longk*ko + kx);
    this.txtlongutm.setText( "" + N );
    } else if (sbutongk.isSelected()){
    int kx= 10000000;
    N = longk + kx;
    this.txtlongutm.setText("" + N);
    }

    }catch (Exception e){
    JOptionPane.showMessageDialog(null, "Fut koordinaten e sakte ne formen: 4345432.345");
    return;
    }
    try{
    int zonagk = Integer.parseInt(this.txtzonagk.getText());

    zonautm = zonagk + 30;
    this.txtzonautm.setText("" + zonautm);
    }catch (Exception e){
    JOptionPane.showMessageDialog(null, "");
    return;
    }


    }//GEN-LAST:event_cmdgktoutmActionPerformed

    private void cmddecimaltoutmMouseClicked(java.awt.event.MouseEv ent evt) {//GEN-FIRST:event_cmddecimaltoutmMouseClicked
    // TODO add your handling code here:
    double pi = 3.14159265358979;
    double a = 6378137, b= 6356752.3142, f=0.00335281066474748, f1 = 298.257223563;
    double rm = Math.pow ((a*b),(1/2));
    double ko = 0.9996;
    double e = Math.sqrt(1- Math.pow((b/a), 2));
    double e1sq = e*e/(1-e*e);
    double n = (a-b)/(a+b);

    // Meridional Arc

    double Ao= a*(1-n+(5*n*n/4)*(1-n) +(81*Math.pow(n,4)/64)*(1-n));
    double Bo = (3*a*n/2)*(1 - n - (7*n*n/8)*(1-n) + 55*Math.pow(n,4)/64);
    double Co = (15*a*n*n/16)*(1 - n +(3*n*n/4)*(1-n));
    double Do = (35*a*Math.pow( n,3)/48)*(1 - n + 11*n*n/16);
    double Eo = (315*a*Math.pow(n,4)/51)*(1-n);
    // calculate ca.
    double sin1 = pi/(180*3600);

    double longzone = 31 + Integer.parseInt(this.txtlongdecimale.getText())/6;
    double longzonecm = 6*longzone - 183;
    double deltalong = (Integer.parseInt(this.txtlongdecimale.getText()) - longzonecm)*pi/180;
    double latrad = Integer.parseInt(this.txtlatdecimale.getText()) * pi /180;
    double longrad = Integer.parseInt(this.txtlongdecimale.getText())*p i/180;




    double rho = a*(1-e*e)/(Math.pow((1 - (Math.pow(e*Math.sin(latrad),2))),(3/2))); //-
    double nu =a /(Math.pow((1-Math.pow(e*Math.sin(latrad),2)),(1/2))); //-
    double meridianarc =Ao*latrad - Bo*Math.sin(2*latrad) + Co*Math.sin(4*latrad) - Do*Math.sin(6*latrad) + Eo*Math.sin(8*latrad);
    //koefic


    double k1 = meridianarc*ko;
    double k2 = nu*Math.sin(latrad)*Math.cos(latrad)*ko/2;
    double k3 = ((nu*Math.sin(latrad)*Math.pow(Math.cos(latrad),3) )/24)*(5-Math.pow(Math.tan(latrad),2)+9*e1sq*Math.pow(Math. cos(latrad),2)+4*Math.pow(e1sq,2)*Math.pow(Math.co s(latrad),4))*ko;
    double k4 = nu*Math.cos(latrad)*ko;
    double k5= Math.pow(Math.cos(latrad), 3)*(nu/6)*(1-Math.pow(Math.tan(latrad),2)+e1sq*Math.pow(Math.co s(latrad),2))*ko;
    double A6 =(Math.pow(deltalong,6)*nu*Math.sin(latrad)*Math.p ow(Math.cos(latrad),5)/720)*(61-58*Math.pow(Math.tan(latrad),2)+Math.pow(Math.tan( latrad),4)+270*e1sq*Math.pow(Math.cos(latrad),2)-330*e1sq*Math.pow(Math.sin(latrad),2))*ko;


    double rownorthing = k1+k2*deltalong*deltalong+k3*Math.pow(deltalong,4) ;
    if (rownorthing < 0){
    rownorthing += 10000000;
    }
    this.txtlatutm.setText(""+ rownorthing);


    double east = 500000+(k4*deltalong+k5*Math.pow(deltalong,3));

    this.txtlongutm.setText (""+ east);

    // double longzone = 31 + Integer.parseInt(this.txtlongdecimale.getText())/6;
    this.txtzonautm.setText("" + longzone);

    }//GEN-LAST:event_cmddecimaltoutmMouseClicked

    private void cmdutmtodecimaleMouseClicked(java.awt.event.MouseE vent evt) {//GEN-FIRST:event_cmdutmtodecimaleMouseClicked
    // TODO add your handling code here:
    double pi = 3.14159265358979;
    double a = 6378137, b= 6356752.3142, f=0.00335281066474748, f1 = 298.257223563;
    double ko = 0.9996;
    double e = Math.sqrt(1- Math.pow((b/a), 2));
    double e1sq = e*e/(1-e*e);

    //calculate Footprint Latitude
    double e1 = (1-Math.pow((1-e*e),(1/2)))/(1+Math.pow((1-e*e),(1/2)));
    double ec=e;
    double ei = (1-Math.pow((1-ec*ec), (1/2)))/(1+Math.pow((1-ec*ec),(1/2)));
    double c1 = 3*ei/2-27*Math.pow(ei, 3)/32;
    double c2 = 21*Math.pow(ei, 2)/16-55*Math.pow(ei,4)/32;
    double c3 = 151*Math.pow(ei,3)/96;
    double c4 = 1097*Math.pow(ei,4)/512;

    double correctedNorthing;
    if(nbutonutm.isSelected()){
    correctedNorthing = 10000000 - Integer.parseInt(this.txtlatutm.getText());
    }
    double eastPrime = 500000- Integer.parseInt(this.txtlongutm.getText());
    double arcLength = Integer.parseInt(this.txtlatutm.getText())/ko;
    double mu = arcLength/(a*(1-Math.pow(e, 2)/4-3*Math.pow(e,4)/64-5*Math.pow(e,6)/256));
    double phi = mu+c1*Math.sin(2*mu)+c2*Math.sin(4*mu)+c3*Math.sin (6*mu)+c4*Math.sin(8*mu);
    double C1 = e1sq*Math.pow((Math.cos(phi)),2);
    double T1 = Math.pow((Math.tan(phi)),2);
    double N1 = a/Math.pow((1-Math.pow((e*Math.sin(phi)),2)),(1/2));
    double R1 = a*(1-e*e)/Math.pow(1-Math.pow((e*Math.sin(phi)),2),(3/2));
    double D = eastPrime/N1*ko;
    double fact1 = N1*Math.tan(phi)/R1;
    double fact2 = D*D/2;
    double fact3 = (5+3*T1+10*C1-4*C1*C1-9*e1sq)*Math.pow(D, 4)/24;
    double fact4 = (61+90*T1+298*C1+45*T1*T1-252*e1sq-3*C1*C1)*Math.pow(D, 6)/720;
    double loFact1 = D;
    double loFact2 = (1+2*T1+C1)*Math.pow(D,3)/6;
    double loFact3 = (5-2*C1+28*T1-3*Math.pow(C1,2)+8*e1sq+24*Math.pow(T1,2))* Math.pow(D, 5)/120;
    double deltalong = (loFact1-loFact2+loFact3)/Math.cos(phi);
    double zonecm = 6*Integer.parseInt(this.txtzonautm.getText())-183;
    double rawlatitude = 180*(phi-fact1*(fact2+fact3+fact4))/pi;

    //-------------

    if (nbutonutm.isSelected()){
    rawlatitude = rawlatitude;}

    this.txtlatdecimale.setText(""+ rawlatitude);

    double longitude = zonecm-deltalong*180/pi;
    this.txtlongdecimale.setText(""+ longitude);



    }//GEN-LAST:event_cmdutmtodecimaleMouseClicked

    private void cmdutmtodmsActionPerformed(java.awt.event.ActionEv ent evt) {//GEN-FIRST:event_cmdutmtodmsActionPerformed
    // TODO add your handling code here:
    double pi = 3.14159265358979;
    double a = 6378137, b= 6356752.3142, f=0.00335281066474748, f1 = 298.257223563;
    double ko = 0.9996;
    double e = Math.sqrt(1- Math.pow((b/a), 2));
    double e1sq = e*e/(1-e*e);

    //calculate Footprint Latitude
    double e1 = (1-Math.pow((1-e*e),(1/2)))/(1+Math.pow((1-e*e),(1/2)));
    double ec=e;
    double ei = (1-Math.pow((1-ec*ec), (1/2)))/(1+Math.pow((1-ec*ec),(1/2)));
    double c1 = 3*ei/2-27*Math.pow(ei, 3)/32;
    double c2 = 21*Math.pow(ei, 2)/16-55*Math.pow(ei,4)/32;
    double c3 = 151*Math.pow(ei,3)/96;
    double c4 = 1097*Math.pow(ei,4)/512;

    double correctedNorthing;
    if(nbutonutm.isSelected()){
    correctedNorthing = 10000000 - Integer.parseInt(this.txtlatutm.getText());
    }
    double eastPrime = 500000- Integer.parseInt(this.txtlongutm.getText());
    double arcLength = Integer.parseInt(this.txtlatutm.getText())/ko;
    double mu = arcLength/(a*(1-Math.pow(e, 2)/4-3*Math.pow(e,4)/64-5*Math.pow(e,6)/256));
    double phi = mu+c1*Math.sin(2*mu)+c2*Math.sin(4*mu)+c3*Math.sin (6*mu)+c4*Math.sin(8*mu);
    double C1 = e1sq*Math.pow((Math.cos(phi)),2);
    double T1 = Math.pow((Math.tan(phi)),2);
    double N1 = a/Math.pow((1-Math.pow((e*Math.sin(phi)),2)),(1/2));
    double R1 = a*(1-e*e)/Math.pow(1-Math.pow((e*Math.sin(phi)),2),(3/2));
    double D = eastPrime/N1*ko;
    double fact1 = N1*Math.tan(phi)/R1;
    double fact2 = D*D/2;
    double fact3 = (5+3*T1+10*C1-4*C1*C1-9*e1sq)*Math.pow(D, 4)/24;
    double fact4 = (61+90*T1+298*C1+45*T1*T1-252*e1sq-3*C1*C1)*Math.pow(D, 6)/720;
    double loFact1 = D;
    double loFact2 = (1+2*T1+C1)*Math.pow(D,3)/6;
    double loFact3 = (5-2*C1+28*T1-3*Math.pow(C1,2)+8*e1sq+24*Math.pow(T1,2))* Math.pow(D, 5)/120;
    double deltalong = (loFact1-loFact2+loFact3)/Math.cos(phi);
    double zonecm = 6*Integer.parseInt(this.txtzonautm.getText())-183;
    double rawlatitude = 180*(phi-fact1*(fact2+fact3+fact4))/pi;

    //-------------

    // if (nbutonutm.isSelected()){
    // rawlatitude = -rawlatitude;}

    double longitude = zonecm-deltalong*180/pi;

    int latdegrees = (int) Math.round(rawlatitude);
    this.txtfigradedms.setText(""+ latdegrees);

    int latminutes = Math.abs((int) Math.round(60*(rawlatitude - latdegrees)));
    this.txtfimindms.setText(""+ latminutes);

    float latseconds = (float) (3600* (Math.abs(rawlatitude)- Math.abs(latdegrees)-latminutes/60));
    this.txtfisekdms.setText(""+ latseconds);

    int longdegrees = (int) Math.round(longitude);
    this.txtlandagradedms.setText(""+ longdegrees);

    int longminutes = Math.abs((int) Math.round(60*(longitude - longdegrees)));
    this.txtlandamindms.setText(""+ longminutes);

    float longseconds = (float) (3600* (Math.abs(longitude)- Math.abs(longdegrees)-longminutes/60));
    this.txtlandasekdms.setText(""+ longseconds);





    }//GEN-LAST:event_cmdutmtodmsActionPerformed

    private void cmddecimaltodmsActionPerformed(java.awt.event.Acti onEvent evt) {//GEN-FIRST:event_cmddecimaltodmsActionPerformed
    // TODO add your handling code here:
    int latdegrees = Math.round(Integer.parseInt(this.txtlatdecimale.ge tText()));
    this.txtfigradedms.setText(""+ latdegrees);

    int latminutes = Math.abs( Math.round(60*( Integer.parseInt(this.txtlatdecimale.getText())- latdegrees)));
    this.txtfimindms.setText(""+ latminutes);

    float latseconds = (float) (3600* (Math.abs(Integer.parseInt(this.txtlatdecimale.get Text()))- Math.abs(latdegrees)-latminutes/60));
    this.txtfisekdms.setText(""+ latseconds);


    int longdegrees = Math.round(Integer.parseInt(this.txtlongdecimale.g etText()));
    this.txtlandagradedms.setText(""+ longdegrees);

    int longminutes = Math.abs((int) Math.round(60*(Integer.parseInt(this.txtlongdecima le.getText()) - longdegrees)));
    this.txtlandamindms.setText(""+ longminutes);

    float longseconds = (float) (3600* (Math.abs(Integer.parseInt(this.txtlongdecimale.ge tText()))- Math.abs(longdegrees)-longminutes/60));
    this.txtlandasekdms.setText(""+ longseconds);
    }//GEN-LAST:event_cmddecimaltodmsActionPerformed

    /**
    * @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 How to Set the Look and Feel (The Java Tutorials > Creating a GUI With JFC/Swing > Modifying the Look and Feel)
    */
    try {
    for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
    if ("Nimbus".equals(info.getName())) {
    javax.swing.UIManager.setLookAndFeel(info.getClass Name());
    break;
    }
    }
    } catch (ClassNotFoundException ex) {
    java.util.logging.Logger.getLogger(vendoskoordinat at.class.getName()).log(java.util.logging.Level.SE VERE, null, ex);
    } catch (InstantiationException ex) {
    java.util.logging.Logger.getLogger(vendoskoordinat at.class.getName()).log(java.util.logging.Level.SE VERE, null, ex);
    } catch (IllegalAccessException ex) {
    java.util.logging.Logger.getLogger(vendoskoordinat at.class.getName()).log(java.util.logging.Level.SE VERE, null, ex);
    } catch (javax.swing.UnsupportedLookAndFeelException ex) {
    java.util.logging.Logger.getLogger(vendoskoordinat at.class.getName()).log(java.util.logging.Level.SE VERE, null, ex);
    }
    //</editor-fold>

    /* Create and display the form */
    java.awt.EventQueue.invokeLater(new Runnable() {

    public void run() {
    new vendoskoordinatat().setVisible(true);
    }
    });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup butonatgk;
    private javax.swing.ButtonGroup butonatutm;
    private javax.swing.JButton cmddecimaltodms;
    private javax.swing.JButton cmddecimaltoutm;
    private javax.swing.JButton cmddmstodecimal;
    private javax.swing.JButton cmddmstoutm;
    private javax.swing.JButton cmdgktoutm;
    private javax.swing.JButton cmdresetdecimale;
    private javax.swing.JButton cmdresetdms;
    private javax.swing.JButton cmdresetgk;
    private javax.swing.JButton cmdresetutm;
    private javax.swing.JButton cmdutmtodecimale;
    private javax.swing.JButton cmdutmtodms;
    private javax.swing.JButton cmdvendosdecimale;
    private javax.swing.JButton cmdvendosdms;
    private javax.swing.JButton cmdvendosgk;
    private javax.swing.JButton cmdvendosutm;
    private javax.swing.JButton jButton1;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JComboBox jComboBox2;
    private javax.swing.JComboBox jComboBox3;
    private javax.swing.JComboBox jComboBox4;
    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 jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JRadioButton nbutongk;
    private javax.swing.JRadioButton nbutonutm;
    private javax.swing.JRadioButton sbutongk;
    private javax.swing.JRadioButton sbutonutm;
    private javax.swing.JTextField txtfigradedms;
    private javax.swing.JTextField txtfimindms;
    private javax.swing.JTextField txtfisekdms;
    private javax.swing.JTextField txtlandagradedms;
    private javax.swing.JTextField txtlandamindms;
    private javax.swing.JTextField txtlandasekdms;
    private javax.swing.JTextField txtlatdecimale;
    private javax.swing.JTextField txtlatgk;
    private javax.swing.JTextField txtlatutm;
    private javax.swing.JTextField txtlongdecimale;
    private javax.swing.JTextField txtlonggk;
    private javax.swing.JTextField txtlongutm;
    private javax.swing.JTextField txtzonagk;
    private javax.swing.JTextField txtzonautm;
    // End of variables declaration//GEN-END:variables
    }

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,308
    Rep Power
    25

    Default Re: Gui doesn't work on browser :S

    This is way too much code for the problem. Try making a small simple program (SSCCE) that compiles, executes and shows the problem. No one wants to work with so much code for testing your problem.

    When i open GUI with browser it doesn't work
    Please explain what file you open with the browser and post the contents of the file.
    If you don't understand my response, don't ignore it, ask a question.

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: Gui doesn't work on browser :S

    Ehoxha likes this.
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  6. #6
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,433
    Blog Entries
    7
    Rep Power
    20

    Default Re: Gui doesn't work on browser :S

    Why should we work ourselves through all tha crappy code generated by a GUI builder? It is nearly impossible to find the relevant code in all that crappy group-layout stuff.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  7. #7
    Ehoxha is offline Member
    Join Date
    Sep 2012
    Posts
    6
    Rep Power
    0

    Default Re: Gui doesn't work on browser :S

    U'r right :/

    Hmmm.. Gui opened on browser. Button's events can work (those who respond algorithms), except button's events of populate database. When i click on them, appeared this message :
    "java.lang.ClassNotFoundException:com.mysql.jdbc.D river" :/

    So, the connection can't realise (It's ok when i run from netbeans.) ??

  8. #8
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,308
    Rep Power
    25

    Default Re: Gui doesn't work on browser :S

    How are you opening a java program in a browser?
    If you don't understand my response, don't ignore it, ask a question.

  9. #9
    Ehoxha is offline Member
    Join Date
    Sep 2012
    Posts
    6
    Rep Power
    0

    Default Re: Gui doesn't work on browser :S

    With .html file using this code:
    <APPLET codebase="classes" code="vijabregore/Appletkoord.class" width=350 height=200></APPLET>

    Is this the right way? :/

  10. #10
    milovan is offline Senior Member
    Join Date
    Jan 2011
    Location
    Belgrade, Serbia
    Posts
    301
    Rep Power
    4

    Default Re: Gui doesn't work on browser :S

    If this is the exact message from compiler

    "java.lang.ClassNotFoundException:com.mysql.jd bc.D river" :/
    then you have typo mistake (extra space) D river

    Correct it and try again..

  11. #11
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: Gui doesn't work on browser :S

    Quote Originally Posted by milovan View Post
    If this is the exact message from compiler
    No, that's an artifact of the forum software. Note the additional space that appeared when you quoted it.

    db
    Ehoxha likes this.
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  12. #12
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: Gui doesn't work on browser :S

    Quote Originally Posted by Ehoxha View Post
    With .html file using this code:
    <APPLET codebase="classes" code="vijabregore/Appletkoord.class" width=350 height=200></APPLET>

    Is this the right way? :/
    No. Go through Lesson: Java Applets (The Java Tutorials > Deployment)

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  13. #13
    milovan is offline Senior Member
    Join Date
    Jan 2011
    Location
    Belgrade, Serbia
    Posts
    301
    Rep Power
    4

Similar Threads

  1. JApplet doesn't load in browser?
    By MarioBrawler in forum New To Java
    Replies: 4
    Last Post: 06-26-2012, 12:52 AM
  2. I wonder why this doesn't work...
    By louboulos in forum New To Java
    Replies: 3
    Last Post: 05-13-2012, 04:59 PM
  3. Replies: 5
    Last Post: 03-11-2012, 02:13 PM
  4. Simple rectangle display applet doesn't work in browser
    By stainluss in forum Java Applets
    Replies: 7
    Last Post: 01-31-2012, 11:38 PM
  5. Jar doesn't work
    By mad72584 in forum New To Java
    Replies: 35
    Last Post: 08-07-2011, 05:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •