java - How to update a jTable from another neatbeans module -
the application working on uses netbeans modules, problem having have jtable in 1 module update contents module.
the module table in acts data panel, information can selected , plotted graph using jfreechart, next modules handles creation of chart, when data being put series plotted doing analysis, simple stuff average error, std etc said information displayed in jtable part of first module spoke of.
so question is, there way access jtable netbeans module , if best way go doing ?
thanks in advance.
add chosen dataset tablemodellistener
tablemodel
. in event handler, update dataset indicated tablemodelevent
in order firedatasetchanged()
implicitly. chart update automatically.
example dataset:
class mydataset extends xyseriescollection implements tablemodellistener { @override public void tablechanged(tablemodelevent e) { // update dataset firedatasetchanged(); } }
example usage:
mydataset dataset = new mydataset(); jtable table = new jtable(…); table.getmodel().addtablemodellistener(dataset);
Comments
Post a Comment