Miletone

Rp0 / Rp1.000.000

Sunday, September 29, 2019

[JAVA] Software Data-in on Shop Free


Sistem ini terdiri dari Login dan Data. Untuk yang telah disediakan selain itu, masih belum tersedia saat ini.Gambar sebagai berikut :
Login
Electronic
Untuk username dan admin : admin dan admin
Kata sandi ZIP : dlcam.blogspot.com
Download :

[JAVA] How to Search Database to JTextField

Action Performed :
try                
                    {
                        Connection connect = Connect.getConnect();
        Statement stat = connect.createStatement();                    
        String sql="SELECT * FROM other Where coder like'"+jTextField7.getText()+"'";                    
        ResultSet isi = stat.executeQuery(sql);                    
       //isi that is Variable 
if(isi.next())
       {                     
           jTextField1.setText(isi.getString(1)); 
           jTextField2.setText(isi.getString(2));                       
           jTextField3.setText(isi.getString(3));
           jTextField5.setText(isi.getString(4));
           jTextField4.setText(isi.getString(5));
           jTextField6.setText(isi.getString(6));
           jTextArea1.setText(isi.getString(7));
       }                  
       else
       {                        
           JOptionPane.showMessageDialog(null,"Invalid Code");
       }                  
       stat.close();
       }                
       catch (Exception ex)               
        {
            JOptionPane.showMessageDialog(null,"Error :"+ex);
                }

[JAVA] How to Search on JTable

Action Performed :
try {
            Connection connect = Connect.getConnect();
            String sql = "select * from other Where coder like '" + jTextField1.getText() + "'";
            Statement stat = connect.createStatement();
            ResultSet res = stat.executeQuery(sql);
            while (res.next()) {
                table.addRow(new Object[]{res.getString(1), res.getString(2), res.getString(3), res.getString(4), res.getString(5), res.getString(6), res.getString(7)});
                //setVisible(true);
                res.close();
                stat.close();
            }

            jTable1.setModel(table);
        } catch (Exception e) {
        }

[JAVA] How to Edit Database on Button

Action Performed :
try
                {
                    Connection connect = Connect.getConnect();
                    //Statement stm=connect.createStatement();
                    String sql="update other set coder ='?', a='?', b='?', c='?', d='?', e='?', f='?' where coder ='?'";
                     PreparedStatement prepare = (PreparedStatement) connect.prepareStatement(sql);
        prepare.setString(1, jTextField1.getText());
        prepare.setString(2, jTextField2.getText());
        prepare.setString(3, jTextField3.getText());
        prepare.setString(4, jTextField5.getText());
        prepare.setString(5, jTextField4.getText());
        prepare.setString(6, jTextField4.getText());
        prepare.setString(7, jTextArea1.getText());
        prepare.executeUpdate();
                    JOptionPane.showMessageDialog(null,"Success");
                    //reset();
                    //table();
                }
                catch(Exception ex)
                {
                    JOptionPane.showMessageDialog(null,"Error :"+ex);
                }

[JAVA] How to JTable Click to JTextField

Click Right on the table, selecr mouse, select and click mouseclicked then you fill code :
try{
            int Linha = jTable1.getSelectedRow();
            nik.setText(jTable1.getValueAt(Linha, 0).toString());
            transnik.setText(jTable1.getValueAt(Linha, 0).toString());
            nama.setText(jTable1.getValueAt(Linha, 1).toString());
            ttl.setText(jTable1.getValueAt(Linha, 2).toString());
            daerahasal.setText(jTable1.getValueAt(Linha, 3).toString());
            asalkiriman.setText(jTable1.getValueAt(Linha, 4).toString());
            /**Blob filenameBlob = (Blob) (jTable1.getValueAt(Linha, 6));
            byte[] content = filenameBlob.getBytes(1L,(int)filenameBlob.length());
            if(jTable1.getValueAt(Linha, 6) !=null){
                ImageIcon image = new ImageIcon(content);
                Image image1 = image.getImage().getScaledInstance(FOTO.getWidth(), FOTO.getHeight(), Image.SCALE_SMOOTH);
                ImageIcon image2 = new ImageIcon(image1);
                FOTO.setIcon(image2);
            }**/
        } catch (Exception e){

        }

[JAVA] How to Print Database on Button Print

Action Performed :
Connection connect = Connect.getConnect();
        try{
                JasperReport JASP_REP = JasperCompileManager.compileReport("src/print/DataPrint.jrxml");
                JasperPrint JASP_PRINT = JasperFillManager.fillReport(JASP_REP, null, connect);
                JasperViewer.viewReport(JASP_PRINT);
        } catch (Exception ev){
         
        }
 Libraries : Jasper Report

[JAVA] How to Open URL on Browser

Action Performed :

try {
  Desktop desktop = java.awt.Desktop.getDesktop();
  URI oURL = new URI("www.dlcam.blogspot.com");
  desktop.browse(oURL);
} catch (Exception e) {
  e.printStackTrace();
}