aswing JTable用法

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);
        }
    }

转载于:https://www.cnblogs.com/as3lib/archive/2012/05/08/2489853.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值