View Code
public class TestJTable extends Sprite { private static const color : ASColor = new ASColor ( 0x5B411E , 1 ); //空皮肤的边界 private static const border : SkinEmptyBorder = new SkinEmptyBorder ( 0 , 0 , 0 , 0 ); public function TestJTable() { AsWingManager.initAsStandard(this); var window:JWindow = new JWindow(); window.setSizeWH(400,200); window.setLocationXY(10,10); window.setBorder(new LineBorder()); window.getContentPane().setLayout( new FlowLayout() ); window.show(); var column:Array = ["姓名","性别","年龄"]; var data:Array = [["Sammy","男","25"],["Ruby","女","23"]]; var model:DefaultTableModel = new DefaultTableModel().initWithDataNames(data,column); var table:JTable = new JTable(model); //水平间隔线 table.setShowHorizontalLines(false); //竖直间隔线 table.setShowVerticalLines(false); //设置字体颜色,前景色 // table.setForeground(color); //设置选中行的时候的字体颜色 table.setSelectionForeground(color); table.setBorder ( border ); //拉伸的模式,随意拉伸 table.setAutoResizeMode ( JTable.AUTO_RESIZE_OFF ); //只能选择一行 table.setSelectionMode ( JTable.SINGLE_SELECTION ); //行高 table.setRowHeight ( 40 ); //设置为透明 table.setOpaque ( false ); //设置单元格border table.setShowGrid ( false ); window.getContentPane().append(table); } }