java - JTable, refreshing rowData vector in static context -


i've declared jtable (inside class extended jpanel constructor) such as

data_table = new jtable(info, header) {     @override     public boolean iscelleditable(int row, int column) {         //disable table editing         return false;     } }; 

where info , column declared

static string[][] info = new string[row][cols]; static string[] header = {"h1", "h2", "h3"}; 

now need update, when events occours, table content invoke static method. how can it?

i don't have tablemodel, i've matrix of string

all tables use tablemodel. when create table matrix of strings used tablemodel.

to update data like:

table.setvalueat(...); 

this cause model updated , model tell table repaint itself.

read swing tutorial on how use tables more information tables.

also, should not using static variables or method. if program poorly designed. again read tutorial better example of how structure code.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -