I need to add a custom handler for double-click on a JDialog's title bar. I need the component to be reactive only if user clicks twice on the title bar; the problem is I don't know how (and I did not find anything useful on the matter) access that part of the component. Can anyone suggest me how to achieve this ?
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
posted
0
this works, but the 'JDialog.setDefaultLookAndFeelDecorated(true)' is a bit ugly
Claude Moore
Ranch Hand
Joined: Jun 24, 2005
Posts: 151
posted
0
Michael,
thank you so much for your reply and providing me a sample. In a nutshell, the part of the code that gives you a reference to JDialog's title is
Your code works, anyway there's another problem: I cannot drag dialog's window anymore. It seems "frozen". It's like if adding a MouseListener to d.getLayeredPane().getComponent(1) inhibits default drag handler...
Michael Dunn
Ranch Hand
Joined: Jun 09, 2003
Posts: 4632
posted
2
it would probably consume the mouseEvent that would normally pass to the default listener handling the dragging.
Or add the custom listener to the dialog (which is where the original drag handler is added).
Took a fair amount of sleuthing through the sources to find the handler.
luck, db
There are no new questions, but there may be new answers.
Claude Moore
Ranch Hand
Joined: Jun 24, 2005
Posts: 151
posted
0
Thak you so much, I've tested Michael's second post code and it works greatly.