当前位置: 技术问答>java相关
救命啊!!!怎样让鼠标点击JTree上的Node时成为手形?
来源: 互联网 发布时间:2017-04-30
本文导语: 救命啊!!!怎样让鼠标点击JTree上的Node时成为手形? | jTree1.addTreeSelectionListener(new TreeSelectionListener() { public synchronized void treeWillCollapse(TreeExpansionEvent event) ...
救命啊!!!怎样让鼠标点击JTree上的Node时成为手形?
|
jTree1.addTreeSelectionListener(new TreeSelectionListener() {
public synchronized void treeWillCollapse(TreeExpansionEvent event)
{
}
public synchronized void treeWillExpand(TreeExpansionEvent event) {
}
public void valueChanged(TreeSelectionEvent e)
{
setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
}
});
public synchronized void treeWillCollapse(TreeExpansionEvent event)
{
}
public synchronized void treeWillExpand(TreeExpansionEvent event) {
}
public void valueChanged(TreeSelectionEvent e)
{
setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
}
});