由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - 求教 Listenser for table in Java
相关主题
关于actionPerformed()的问题possible soluction
how to set java run time locale/encoding?help: cannot generate index.html using javadoc
一个java servelet 的问题求教
实在搞不定了,问问大虾,java里面得itemListenerHow to resize an icon?
有一系列的buttonSwing help
Hibernate query怎么在application实现delay?
Re: component之间怎样送消息?大家用swing还是swt呀?
Re: Swing Buttonthe best way to transfer data?
相关话题的讨论汇总
话题: listenser话题: table话题: java话题: button
进入Java版参与讨论
1 (共1页)
l***r
发帖数: 459
1
I have a button and a JTable. I want to set button to enable if user type or
change content one row in table. Which listenser should I use? I implement
KeyTyped in table but it doesn't work.
Thanks!
s***m
发帖数: 28
2
May be you can try to look at TableModelListener interface. You may be able to
capture the event in tableChanged interface method.

【在 l***r 的大作中提到】
: I have a button and a JTable. I want to set button to enable if user type or
: change content one row in table. Which listenser should I use? I implement
: KeyTyped in table but it doesn't work.
: Thanks!

h******b
发帖数: 312
3
myJTable.addMouseListener(myMouseListener);
.....
//inner class
class myMouseListener extends MouseAdapter(MouseEvent e){
public void mouseClicked(MouseEvent e){
if(myJTable.getSelectedRow() != -1) myButton.setEnabled(true);
}
}
this should work, but check my typings, in a hurry, hehe!
Good luck!
Haibo

to
or

【在 s***m 的大作中提到】
: May be you can try to look at TableModelListener interface. You may be able to
: capture the event in tableChanged interface method.

1 (共1页)
进入Java版参与讨论
相关主题
the best way to transfer data?有一系列的button
A question about JavaScript (转载)Hibernate query
AJAX or javascript forum recommendation?Re: component之间怎样送消息?
土问一个鼠标事件问题Re: Swing Button
关于actionPerformed()的问题possible soluction
how to set java run time locale/encoding?help: cannot generate index.html using javadoc
一个java servelet 的问题求教
实在搞不定了,问问大虾,java里面得itemListenerHow to resize an icon?
相关话题的讨论汇总
话题: listenser话题: table话题: java话题: button