I am using a glasspane on the top of my application. However I want the JTabbedPane to be clickable. I know how to do it with JButton by adding a mouse listener on the glasspane and then use this method getDeepestComponentAt() from SwingUtilities. However when I do the same for JTabbedPane I am able to retrieve the JTabbedPane instance with this method, but I want to select the tab that the user clicked. I can't use the setSelectedIndex(..)
(at least not directly) since I only have a point on the content pane. Anyone who knows how to allow for tab selection?
This is basically how I do it with the button: http://docs.oracle.com/javase/tutorial/uiswing/components/rootpane.html (look at the example for glasspane).