Re: Hi, I need your ideas. swing problems!!!!!!
- From: "Fahd Shariff" <fahdshariff@xxxxxxxxx>
- Date: 28 Oct 2005 08:18:13 -0700
If you add a mouse listener to a tree, it will work on nodes.
tree.addMouseListener (new MouseAdapter() {
public void mousePressed (MouseEvent e) {
if (e.isPopupTrigger()) {
popup.show (e.getComponent(),
e.getX(), e.getY());
}
}
}) ;
}
You can find the node that was clicked on by:
DefaultMutableTreeNode node = (DefaultMutableTreeNode)
tree.getLastSelectedPathComponent();
--
Fahd Shariff
http://www.fahdshariff.cjb.net
.
- References:
- Hi, I need your ideas. swing problems!!!!!!
- From: smat
- Hi, I need your ideas. swing problems!!!!!!
- Prev by Date: Re: TableSorter reselect selected rows
- Next by Date: How to size a JTextField according to a fixed string length?
- Previous by thread: Hi, I need your ideas. swing problems!!!!!!
- Next by thread: getParentDirectory
- Index(es):