How Can we add a Google like Search box in java Swing? -
this question has answer here:
i tried code dynamic list in combobox
after typing not add whole word on selected item in combobox.
how can make more dynamic google search box?
you can use code dynamically update combobox using database connection.....
//code: string pattern=tabletcombobox.getselecteditem().tostring(); system.out.println(pattern); //tabletcombobox.setselecteditem(pattern); //autocompletedecorator decorator; //autocompletedecorator.decorate(tabletcombobox); try { class.forname("com.mysql.jdbc.driver"); connection con=drivermanager.getconnection(url,username,password); statement st=con.createstatement(); string query="select * tablet"; resultset rs=st.executequery(query); int i=1; while(rs.next()) { tabletcombobox.add(this, rs.getstring(1),i++); } } catch(exception e) { system.err.println(e); }
Comments
Post a Comment