⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mybilltablemodel.java

📁 基于 C/S 模式的网上购物系统
💻 JAVA
字号:
package RegisterAndLogin;
import javax.swing.table.*;
public class MyBilltableModel  extends AbstractTableModel {
	final String[] columnNames={"买方","商品","数量","原价","议价","时间"};
	 final Object[][]data=new Object [20][6]; 
	 public MyBilltableModel()
	 {
		 for(int i=0;i<20;i++)		 
		   for(int j=0;j<6;j++)
			 data[i][j]="";	   
		 
		 
	 }
	 public int getColumnCount() {
	     return columnNames.length;
	 }
	 
	 public int getRowCount() {
	     return data.length;
	 }

	 public String getColumnName(int col) {
	     return columnNames[col];
	 }

	 public Object getValueAt(int row, int col) {
	     return data[row][col];
	 }
	 public void setValueAt(Object value,int row,int col)
	 {
		 data[row][col]=value;
		 fireTableCellUpdated(row, col);
	 }
	 public boolean isCellEditable(int row, int col) {
	     //Note that the data/cell address is constant,
	     //no matter where the cell appears onscreen.
	     if (col < 2) { 
	         return false;
	     } else {
	         return true;
	     }
	 }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -