Creating a table with my own data, how to use JTable Constructors? :(

ola!

I am trying to create a table with my data and with predefined column names.

I already searched and saw JTable's Constructor:

JTable(Object[][] rowData, Object[] columnNames) .

Now, it would be perfect if instead of the array rowData which is of Object type I could put my own array, I have this:

Data[] IPdata= new Data[50];

IPdata = new Data();

where Data class looks like this:

public class Data {

public String srcIP, srcPort, destIP,destPort, protocol;

int size;

public Data() {

this.srcIP=srcIP;

this.srcPort=srcPort;

this.destIP=destIP;

this.destPort=destPort;

this.protocol=protocol;

this.size=size;

}

}

any ideas how I can go around this? :P

thank you for your time!

Cris

[836 byte] By [Cris.Mariaa] at [2007-11-27 4:19:33]
# 1
sorry I have these as arrays:Data[] IPdata= new Data[50];IPdata = new Data();//copy pasted wrongly :P
Cris.Mariaa at 2007-7-12 9:26:30 > top of Java-index,Desktop,Core GUI APIs...