当前位置: 代码迷 >> J2SE >> 关于继承jtable的有关问题
  详细解决方案

关于继承jtable的有关问题

热度:52   发布时间:2016-04-24 00:43:52.0
关于继承jtable的问题
我继承了jtable重写了getSelectedRow()方法,但是程序没有读到我的方法
@Override
public int getSelectedRow(){
System.out.println("------------------");
return super.getSelectedRow();
}
不知是为什么;

------解决方案--------------------
父类引用指向子类对象,写对了吧。
父类A a = 子类B b();
int i = a.getSelectedRow();
------解决方案--------------------
探讨

JTable tbl_Child = new NestedTable(tm);
tbl_Child.getSelectedRow();
没错吧,
  相关解决方案