我记得核心技术swing上说jtable是基于列的,
也许没有简单的办法实现。
也许没有简单的办法实现。
解决方案 »
- system.out.println是什么意思?
- Annotations不懂啊
- 我是新手,想请各位高手帮忙!
- 帮忙解释一下
- 救命啊!java里面怎么生成象com对象那种clsid???
- 我用200分求一个javamail做的邮件系统的原码,要求比较完善!
- 《JAVA编程思想》看完后,该看些什么书了?
- java 的一个很难的问题,欢迎高手来解答
- 求大神,java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
- 求教,Java se开发坦克大战
- 小问题。。。。只想知道为什么。。。。
- 请问哪里有用applet做的,能绘制数学曲线的动态演示系统?各位,请不吝赐教
{
private int row=0;
private int col=0;
private double diffx=0;
private double mouseOldX=0;
private double mouseOldY=0;
private boolean bmove=false;
private int oldrowheight=0;
public void mouseMoved(MouseEvent e)
{
row=tableView.rowAtPoint(e.getPoint());
col=tableView.columnAtPoint(e.getPoint());
oldrowheight=tableView.getRowHeight(row-1);
Rectangle rect=tableView.getCellRect(row,col,true);
double rowX=rect.getX();
double rowY=rect.getY();
mouseOldY=e.getY();
if (Math.abs(rowY-e.getY())<=1 )
{
//System.out.println(rect.getX()+","+rect.getY()+","+e.getX()+","+e.getY());
//this.snew Cursor(Cursor.TEXT_CURSOR);
bmove=true;
frame.setCursor(Cursor.S_RESIZE_CURSOR);
}
else
{
frame.setCursor(Cursor.DEFAULT_CURSOR);
bmove=false;
}
}
public void mouseDragged(MouseEvent e)
{
if (bmove)
{
int rowHeight=oldrowheight+(int)(e.getY()-mouseOldY);
if (rowHeight>1)
tableView.setRowHeight(row-1,rowHeight);
}
}
});