Is there any way I can detect doubleclick on tab header in JTabbedPane ?
I do not mean ChangeEvent..
Is there any way I can detect doubleclick on tab header in JTabbedPane ?
I do not mean ChangeEvent..
I have found solution few seconds after posting this:
jTabbedPane1.addMouseListener(new java.awt.event.MouseAdapter() {
@Override
public void mouseClicked(java.awt.event.MouseEvent evt) {
if (evt.getClickCount()==2 && jTabbedPane1.indexAtLocation(evt.getX(), evt.getY())==3) {
//deteced doubleclick on tab with index 3
}
}
});
Add a
MouseListener
to the tabbed pane.Then you can determine which tab was double clicked by using something like: