hi everyone i try to create some program that made button from the array and this array get its items form result set , can you help me because i have try it there's no error message but program can't be launch where i've got wrong and once morei am using netbeans ,
import java.sql.*; import java.util.logging.Level; import java.util.logging.Logger; import java.awt.*; import java.awt.event.*; import javax.media.Controller; import javax.swing.*; public class betapoint extends javax.swing.JFrame { public String[] buttonTxt; JButton[] buttons = new JButton[buttonTxt.length]; public betapoint() { initComponents(); } public void ButtonPanel() { for (int i = 0; i < buttons.length; i++) { buttons[i] = new JButton(buttonTxt[i]); buttons[i].setSize(80, 80); buttons[i].addActionListener((ActionListener) jPanel1); this.add(buttons[i]); } } public void getshow() { float nilai = Float.parseFloat(jTextField1.getText()); try { Class.forName(Koneksi.driver); Connection konek1; konek1 = DriverManager.getConnection (Koneksi.database, Koneksi.user, Koneksi.pass); Statement st1 = konek1.createStatement(); ResultSet rs1 = st1.executeQuery("SELECT no FROM lookout WHERE nilai <='" + nilai + "'"); while(rs1.next()) { String buttonTxt = rs1.getString("no"); System.out.println(buttonTxt); } konek1.close(); } catch (SQLException ex) { Logger.getLogger(betapoint.class.getName()).log(Level.SEVERE, null, ex); } catch (ClassNotFoundException ex){ System.out.println("ERROR ->>> can't open Database . . ."); Logger.getLogger(betapoint.class.getName()).log(Level.SEVERE, null, ex); } } private void initComponents() { jButton1 = new javax.swing.JButton(); jTextField1 = new javax.swing.JTextField(); jPanel1 = new javax.swing.JPanel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jButton1.setText("ok"); private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { getshow(); } public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new betapoint().setVisible(true); } }); } private javax.swing.JButton jButton1; private javax.swing.JPanel jPanel1; private javax.swing.JTextField jTextField1;