加一行,让其获得焦点
public void mouseClicked(MouseEvent me) {
if (me.getButton() == MouseEvent.BUTTON3) {
tree.setSelectionRow(tree.getRowForLocation(me.getX(), me.getY()));
....
}
}
if (me.getButton() == MouseEvent.BUTTON3) {
tree.setSelectionRow(tree.getRowForLocation(me.getX(), me.getY()));
....
}
}