JTable的问题(请大家进来看看)

tuchunliu 2005-01-25 09:45:24
当程序已运行后,当我单击JTable表中某一行某一列的时候,在后台如何得到我所选择的这一行这一列的数据?
...全文
66 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
tuchunliu 2005-01-25
  • 打赏
  • 举报
回复
OK,可以了,谢了,^-^
BasaraTracy 2005-01-25
  • 打赏
  • 举报
回复
getValueAt
public Object getValueAt(int row,
int column)Returns the cell value at row and column.
Note: The column is specified in the table view's display order, and not in the TableModel's column order. This is an important distinction because as the user rearranges the columns in the table, the column at a given index in the view will change. Meanwhile the user's actions never affect the model's column ordering.


Parameters:
row - the row whose value is to be queried
column - the column whose value is to be queried
Returns:
the Object at the specified cell
saz 2005-01-25
  • 打赏
  • 举报
回复
JTable lvGroupInfo = new JTable();
String groupID = lvGroupInfo.getValueAt(lvGroupInfo.getSelectedRow(),0).toString();
hym_wy 2005-01-25
  • 打赏
  • 举报
回复
我也正在问这个问题呢,帮你一起顶吧

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧