Results 1 to 1 of 1
- 04-24-2011, 09:09 PM #1
synchronisation the view of JList
Hi,
am using the H2 BD, the conncetion is okay and all is great in my VOIP project,
But the problem comes when i want to add a new contact so when i clic Add the JList that shows the contact on the BD don't add the new user contcat
this is the code how the JList get the conten
private void initComponents() {
private javax.swing.JList Listcontact;
Listcontact = new javax.swing.JList();
try {
Class.forName("org.h2.Driver");
Connection conn = DriverManager.
getConnection("jdbc:h2:~/voipdb", "sa", "");
// add application code here
Statement stm;
stm = conn.createStatement();
String req="select NOM, PRENOM from CONTACT";
ResultSet rst;
rst = stm.executeQuery(req);
DefaultListModel dlm=new DefaultListModel();
while(rst.next())
{
String stt = rst.getString("NOM");
String stt2 = rst.getString("PRENOM");
String stt3 = (stt + " "+ stt2);
dlm.addElement(stt3);
Listcontact.setModel(dlm);
}
conn.close();
} catch (Exception ex) {
System.out.println(ex.getMessage());
}
}
and i have a buton that has a function to add in the table,
how get the synchronisation the view of JList ?
Similar Threads
-
Synchronisation problem
By Joshy910 in forum SWT / JFaceReplies: 3Last Post: 08-12-2010, 03:52 PM -
How enter this mode-gui/design-view/code-view
By lse123 in forum NetBeansReplies: 0Last Post: 02-28-2010, 09:09 PM -
thread synchronisation
By nabila.abdessaied in forum Threads and SynchronizationReplies: 0Last Post: 04-01-2009, 05:11 PM -
Updating a view using actions in a seperate view
By xcallmejudasx in forum EclipseReplies: 0Last Post: 10-24-2008, 09:24 PM -
How to create tree view of the given JList implementation
By aneesahamedaa in forum AWT / SwingReplies: 3Last Post: 10-06-2008, 02:45 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks