Hi ,
I am wondering if someone can help me with this ....
I am trying to use the JTreeTable sample (from the sun website) and couldn't
get the boolean columns displayed with th default renderer (checkbox)
Here is how I am using the sample :
in FileSystemModel2 I modified this lines :

// Names of the columns.
static protected String[] cNames = {"Name", "Size", "Type", 
"Modified","size>100"};

// Types of the columns.
static protected Class[] cTypes = { TreeTableModel.class,
Integer.class, String.class,
Date.class,Boolean.class};
....
.....
public Class getColumnClass(int column) {
return cTypes[column];
}

/**
* Returns the value of the particular column.
*/
public Object getValueAt(Object node, int column) {
FileNode fn = (FileNode)node;

try {
switch(column) {
case 0:
return fn.getFile().getName();
case 1:
if (fn.isTotalSizeValid()) {
return new Integer((int)((FileNode)node).totalSize());
}
return null;
case 2:
return fn.isLeaf() ? "File" : "Directory";
case 3:
return fn.lastModified();
case 4:
if (fn.isTotalSizeValid()) {
return new Boolean( (int)((FileNode)node).totalSize() > 100);
}
return new Boolean(false);

}
}
catch (SecurityException se) { }

return null;
}

Did I miss something ??

Thanks for any help.


_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx

_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to