java - Filling JList with table -
does have tutorial fill jlist table sql query. jlist update every create or delete table.
select name sqlite_master type = 'table';
any appreciated.
this simple, not need tutorial :) build jlist
resuting list of elements using this costructor.
iterate on query result cursor , fill vector
elements got db. use vector
underlying data container (model) building jlist
:
vector<string> elements = new vector<string>(); while (query.next()) { // or whatever appropriate elements.add(query.getstring("name")); } jlist mylist = new jlist(elements);
you should split db query code (model related) gui building (view) ease future maintainance , decouple structure in so-called mvc structure, out of scope of question.
Comments
Post a Comment