Data Load « JTable « Java Swing Q&A





3. Load JTable Data    coderanch.com

4. How to Load data in Jtable using Bean class?    coderanch.com

Hello ... I am a java beginner , I have a small problem which i am not able to solve it.. i have Jtable in which i want to load data from bean class using iterator. Here is my code.. JTable table = new JTable(); String[] columnNames = {"EmpId", "EmpName"}; Object[][] data = null; table.setModel(new DefaultTableModel(data,columnNames)); int col=table.getColumnCount(); System.out.println(col); try { ...

5. How to Load data in Jtable using Bean class?    coderanch.com

JTable table = new JTable(); String[] columnNames = {"EmpId", "EmpName"}; Object[][] data = null; table.setModel(new DefaultTableModel(data,columnNames)); int col=table.getColumnCount(); System.out.println(col); try { ArrayList empNameArray=adminDao.getEmpName(empbean); EmployeeBean empBean; Iterator ito=empNameArray.iterator(); // // int row=0; // while(ito.hasNext()) // { // empBean=(EmployeeBean)ito.next(); // table.setValueAt(empBean.getId(), row, 1); // table.setValueAt(empBean.getFirstName(), row,2 ); // row++; // // ArrayList data // }