/** 设置是否可更改 */
public boolean isCellEditable(int rowIndex, int columnIndex)
{
if (columnIndex < 2)
{
return false;
}
else
{
return true;
}
}
/** 设置单元格值 */
public void setValueAt(Object aValue, int rowIndex, int columnIndex)
{
if (debug)
{
System.out.println("设置值在 " + rowIndex + " , " + columnIndex + " to" + aValue + "(an instance of "
+ aValue.getClass() + " )");
}
if (data[0][columnIndex] instanceof Integer && !(aValue instanceof Integer))
{
try
{
data[rowIndex][columnIndex] = Integer.valueOf(aValue.toString());
fireTableCellUpdated(rowIndex, columnIndex);
}
catch (Exception e)
{
JOptionPane.showMessageDialog(FrameTableDemo.this, "the \"" + getColumnName(columnIndex)
+ "\"列只接受整形数据.");
}
}
else
{
data[rowIndex][columnIndex] = aValue;
fireTableCellUpdated(rowIndex, columnIndex);
}
if (debug)
{
System.out.println("数据的最新改变值");
printDebugDate();
}
}
private void printDebugDate()
{
int numRows = getRowCount();
int numCols = getColumnCount();
for (int i = 0; i < numRows; i++)
{
System.out.print(" row " + i + ":");
for (int j = 0; j < numCols; j++)
{
System.out.println(" " + data[i][j]);
}
System.out.println();
}
System.out.println("-----------------------------");
}
/** 设置列名 */
public String getColumnName(int column)
{
return columnNames[column];
}
}
public static void main(String[] args)
{
FrameTableDemo frame = new FrameTableDemo();
frame.pack();
frame.setVisible(true);
}
}
分享到:
相关推荐
变压器变频器配电柜电路控制原理图CAD施工图纸设备控制图恒温烘房电气控制柜原理图120KW
使用R语言的jiebaR包的情感分析_jiebaR_emotion
springboot基于双因素身份认证的学生社团管理系统论文
鳄梨酱guacamole:1.5.5和guacd:1.5.5容器
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。 替换数据可以直接使用,注释清楚,适合新手
小程序&小工具类&生活圈(源码+截图+源码导入教程和视频).zip
记录r语言单细胞学习_Single-cell
本项目是基于Javascript开发的微信小程序电影资讯平台,包含44个文件,其中包括10个JavaScript脚本文件、9个JSON配置文件、8个WXSS样式表文件、6个WXML页面文件、4个PNG图像文件、1个EOT字体文件、1个SVG矢量图文件、1个TTF字体文件、1个WOFF字体文件和1个WOFF2字体文件。该项目旨在为用户提供一个便捷、高效的电影资讯浏览和搜索平台,支持电影信息展示、分类查询、用户评价等功能,以提升用户体验和互动性。
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。 替换数据可以直接使用,注释清楚,适合新手
变压器变频器配电柜电路控制原理图CAD施工图纸设备控制图控制室平面布置图
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。 替换数据可以直接使用,注释清楚,适合新手
本项目是基于Java开发的飞滴出行网约车2022,包含81个文件,其中包括52个Java源代码文件、11个XML配置文件、8个gitignore文件、5个YAML配置文件、3个HTML页面文件和2个Markdown文档文件。该项目旨在为用户提供一个便捷、高效的网约车服务平台,支持乘客下单、司机接单、行程跟踪等功能,以提升用户体验和运营效率。
NBA决策树R语言实践_NBA-decision-tree
解决oracle退格键乱码问题
1.版本:matlab2014/2019a/2024a 2.附赠案例数据可直接运行matlab程序。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。 替换数据可以直接使用,注释清楚,适合新手
一个R语言的数据分析及可视化_R_Language_analysis_visualization
STM32F4使用通用定时器生成PWM和脉冲(只有干货、注释详细、附程序包)
包含 1)系统的文档教程 2)实例讲义 3)模型源文件 DesignModeler(简称DM)是ANSYS Workbench中的一个重要模块,它主要用于几何模型的创建、修复、简化和前处理。以下是对DesignModeler的详细介绍: 一、主要功能 全参数化实体建模:DesignModeler支持全参数化建模,用户可以通过设置参数来控制模型的尺寸和形状,便于后续的优化分析和数据传递。 CAD模型修复与简化:从CAD软件导入的模型可能存在细节缺失或错误,DesignModeler提供了多种工具来修复这些问题,并可以对模型进行简化,以提高计算效率。 概念建模:DesignModeler还具备概念建模功能,如创建梁模型或面(壳体)概念模型,为后续的有限元分析提供基础。 前处理功能:包括对几何模型的修改、分割、中面抽取等,为后续的网格划分和仿真分析做好准备。
华为杯《统计学习方法-李航》200页PDF手推公式细节讲解,包含详细的目录以及R语言代码实现,可结合《统_statistic-learning-R-note.zip