JidePopup and Tool Tips

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

JidePopup and Tool Tips

Postby pauer » Tue May 20, 2008 6:31 am

Hi all,

I am using a JidePopup with several components on it. It seems, that tool tips don't function on all components laying on this JidePopup.

Here is a little test case to show this problem:

Code: Select all
public class ToolTipDemo extends JidePopup {

   public ToolTipDemo() {
      super();

      JTextField textField = new JTextField();
      textField.setToolTipText("TextField");

      JButton button = new JButton("Close");
      button.addActionListener (new ActionListener () {
         public void actionPerformed(ActionEvent e) {
            hidePopup();
         }
      });
      button.setToolTipText("Button");

      getContentPane().add(textField, BorderLayout.CENTER);
      getContentPane().add(button, BorderLayout.SOUTH);

      packPopup();
   }

   public static void main(String[] args) {
      ToolTipDemo toolTipDemo = new ToolTipDemo();
      toolTipDemo.showPopup();
   }

}


Can anybody tell me how to make the tool tips work?

Thanks,
Daniel
pauer
 
Posts: 4
Joined: Tue Nov 07, 2006 2:02 am

Postby JIDE Support » Tue May 20, 2008 7:00 am

The tooltip will not be shown if the window doesn't have focus. It is JDK thing that has nothing to do with JIDE. So in order to show tooltip, you will have to make the JidePopup focus. You can either call popup.setFocusable or popup.setDefaultFocusComponent, in your case, to the textField.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

parent component

Postby pauer » Wed May 21, 2008 7:05 am

Thank you for your help. You are right, that I have to call popup.setDefaultFocusComponent(Component) to make the popup focusable and therefore to show a tool tip on a component laying on the popup.

But there's more to it than that. I figured out, that it is important to call popup.showPopup(Component) to pass the popup window's owner (e.g. a JFrame or JDialog). If I call only popup.showPopup() without a parent container, the popup is still not focusable.

Ciao,
Daniel
pauer
 
Posts: 4
Joined: Tue Nov 07, 2006 2:02 am

Postby JIDE Support » Wed May 21, 2008 8:07 am

You are right.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 83 guests