Suppose I have a text field in java (like in gmail home page you have username field )
So I want to fill that field automatically by taking record from the database so is there any mechanism in java to handle this problem??
![]() |
Suppose I have a text field in java (like in gmail home page you have username field )
So I want to fill that field automatically by taking record from the database so is there any mechanism in java to handle this problem??
I want to invoke webpage to get its html. What is the best html parser for this in java?
Will java heap size setting work if I put the parameter at the end of the java call
Hello there, I need source code for "Implementation of various locking and synchronization mechanisms for concurrent
linked lists, concurrent queues, and concurrent stacks".
I think you might be aware with creating a DataBase Connection class and calling that class form your Text Field implemented class.. I not going to revise you those staff again.. :)
add a jlist right below your text field and enclose it inside a jPanel .So that will load your database fields on it.Text field name is jTextField .List name is JList here is a code example (make changes as you require) :
private void jTextFieldKeyReleased(KeyEvent evt) {
try {
String compareString = jTextField.getText();
String sql = "SET YOUR SELECT QUERY HERE ";
ps = conn.prepareStatement(sql);
rs = ps.executeQuery();
DefaultListModel dlm = new DefaultListModel();
while (rs.next()) {
String s = rs.getString("SET YOUR DATABASE TABLE COLUMN NAME HERE");
if (s.substring(0, compareString.length()).equalsIgnoreCase(compareSt ring)) {
jPanel.setVisible(true);
dlm.addElement(s);
jList.setModel(dlm);
}}
} catch (Exception ex) {}}
All times are GMT -7. The time now is 02:47 PM. |