这是使用swing
创建表格的代码。
var colNames: Object[] = ["S.No.", "Item Name", "Formulation", "Dosage" , "Batch No.", "Expiry", "MRP", "Purchase price","Selling Price", "Qty", "T.Qty", "R.Qty", "Foo", "Bar"];
var colType: Class[] = [java.lang.Integer.class, java.lang.String.class, java.lang.String.class,
java.lang.String.class, java.lang.Integer.class, java.lang.String.class,
java.lang.Double.class, java.lang.Double.class, java.lang.Double.class,
java.lang.Integer.class, java.lang.Integer.class, java.lang.Integer.class, java.lang.Integer.class, java.lang.Integer.class];
var colEditable: Boolean[]= [false, false, false, false, false, false, false, false, false, false, true, false, false, false];
var colWidth: Integer[] = [35, 50, 120, 75, 40, 66, 56, 50, 46, 40,40, 40, 0, 0];
var cashTable = CashSalesTableObj.createTable(rowNo, colNames, colType, colEditable, colWidth, "Sales");
这完美无缺。但我想删除最后两个颜色Foo
,Bar
..如果我喜欢下面的颜色,
var colNames: Object[] = ["S.No.", "Item Name", "Formulation", "Dosage" , "Batch No.", "Expiry", "MRP", "Purchase price","Selling Price", "Qty", "T.Qty", "R.Qty"];
var colType: Class[] = [java.lang.Integer.class, java.lang.String.class, java.lang.String.class,
java.lang.String.class, java.lang.Integer.class, java.lang.String.class,
java.lang.Double.class, java.lang.Double.class, java.lang.Double.class,
java.lang.Integer.class, java.lang.Integer.class, java.lang.Integer.class];
var colEditable: Boolean[]= [false, false, false, false, false, false, false, false, false, false, true, false];
var colWidth: Integer[] = [35, 50, 120, 75, 40, 66, 56, 50, 46, 40,40, 40];
var cashTable = CashSalesTableObj.createTable(rowNo, colNames, colType, colEditable, colWidth, "Sales");
它无效。列未正确呈现。