Tooltip Problem with Synth

Discussion in 'Java' started by Harri E, Sep 25, 2006.

  1. Harri E

    Harri E Guest

    Hello,

    i have a very strange behaviour with Tooltips in Synth. I created a
    component extending JTextField using a own Tooltip. First time the
    Tooltip appears there are no problems but from second time on i get an
    Exception. To demonstrate the problem i created a very simple class
    which containes all the necessary parts to demonstrate the behaviour.


    public class MyToolTipField extends JTextField {
    JToolTip tooltip = new JToolTip();


    @Override
    public JToolTip createToolTip() {
    if(this.tooltip==null){
    this.tooltip = new JToolTip();
    }
    return this.tooltip;
    }

    }



    the Exception is:

    Exception in thread "AWT-EventQueue-1" java.lang.NullPointerException
    at
    javax.swing.plaf.synth.SynthToolTipUI.getPreferredSize(SynthToolTipUI.java:139)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1615)
    at javax.swing.ToolTipManager.showTipWindow(ToolTipManager.java:233)
    at
    javax.swing.ToolTipManager$insideTimerAction.actionPerformed(ToolTipManager.java:655)
    at javax.swing.Timer.fireActionPerformed(Timer.java:271)
    at javax.swing.Timer$DoPostEvent.run(Timer.java:201)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
    at
    java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at
    java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at
    java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at
    java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Exception in thread "AWT-EventQueue-1" java.lang.NullPointerException
    at
    javax.swing.plaf.synth.SynthToolTipUI.getPreferredSize(SynthToolTipUI.java:139)
    at javax.swing.JComponent.getPreferredSize(JComponent.java:1615)
    at javax.swing.ToolTipManager.showTipWindow(ToolTipManager.java:233)
    at javax.swing.ToolTipManager.mouseMoved(ToolTipManager.java:591)
    at
    java.awt.AWTEventMulticaster.mouseMoved(AWTEventMulticaster.java:272)
    at java.awt.Component.processMouseMotionEvent(Component.java:5533)
    at
    javax.swing.JComponent.processMouseMotionEvent(JComponent.java:3144)
    at java.awt.Component.processEvent(Component.java:5257)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Component.dispatchEventImpl(Component.java:3955)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at
    java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
    at
    java.awt.LightweightDispatcher.processMouseEvent(Container.java:3905)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
    at java.awt.Container.dispatchEventImpl(Container.java:2010)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at
    java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at
    java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at
    java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at
    java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)



    When i do not user Synth but e.g MetallLookAndFell i do not have these
    Problems.

    Has anyone a comparable Problem an maybe allready solved it?
    Maybe the Problems is how i defined the Tooltip in my Synth-xml file?


    <style id="tooltip" clone="default">
    <insets top="1" left="5" bottom="1" right="5" />
    <state>
    <color idref="colorFormTextRegular" type="TEXT_FOREGROUND" />
    <color idref="colorSelectTextBackground" type="BACKGROUND" />
    </state>
    </style>
    <bind style="tooltip" type="region" key="ToolTip" />



    Thanks for any help

    Harri E.
     
    Harri E, Sep 25, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    0
    Views:
    373
  2. Synth L&F as jar

    , Aug 14, 2006, in forum: Java
    Replies:
    2
    Views:
    430
  3. Guy_Sweden
    Replies:
    3
    Views:
    703
    Mike Treseler
    Oct 26, 2006
  4. Radu
    Replies:
    1
    Views:
    551
    Bruce Barker
    Jan 8, 2007
  5. hogcia
    Replies:
    0
    Views:
    598
    hogcia
    Apr 17, 2009
Loading...

Share This Page