SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Spoor wrote:I've tried it, and the answer is no. Even though JToolTip extends JComponent and therefore indirectly Container, thereby giving it all the methods to add and remove child components, these are ignored.
luck, db
There are no new questions, but there may be new answers.
Darryl Burke wrote:
Rob Spoor wrote:I've tried it, and the answer is no. Even though JToolTip extends JComponent and therefore indirectly Container, thereby giving it all the methods to add and remove child components, these are ignored.
Actually, the JToolTip has a null layout, so any component added without specifying its bounds isn't seen. Setting a layout manager to the tooltip doesn't resize it either, so that too must be taken care of in client code. Third, a non-null tool tip text must be set to register with the tool tip manager. An empty String suffices for this.
This code can probably be improved on, but it's provided as a proof of concept.
I do suspect that what Andraz is really after is a JPopupMenu.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
luck, db
There are no new questions, but there may be new answers.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Andraz Poje wrote:JPopup could work for me, but I have one more problem.
Triggering popup with left mouse button instead of right one.....
Andraz Poje wrote:I tryed adding (event.getButton() == MouseEvent.BUTTON1), but it doesnt work..... Only works on right mouse button.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Paul Clapham wrote:And why is that a requirement? When you decide to violate the standard user interface design, you should at least explain why it's necessary. And that's what you are doing.
Rob Spoor wrote:Move that inner if to outside the other if and try again..
Andraz Poje wrote:I am programming some rundown list of students which is on touchscreen monitor.
luck, db
There are no new questions, but there may be new answers.