Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Tooltip Problem with Synth

Reply
Thread Tools

Tooltip Problem with Synth

 
 
Harri E
Guest
Posts: n/a
 
      09-25-2006
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.getPreferred Size(SynthToolTipUI.java:139)
at javax.swing.JComponent.getPreferredSize(JComponent .java:1615)
at javax.swing.ToolTipManager.showTipWindow(ToolTipMa nager.java:233)
at
javax.swing.ToolTipManager$insideTimerAction.actio nPerformed(ToolTipManager.java:655)
at javax.swing.Timer.fireActionPerformed(Timer.java:2 71)
at javax.swing.Timer$DoPostEvent.run(Timer.java:201)
at java.awt.event.InvocationEvent.dispatch(Invocation Event.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java: 461)
at
java.awt.EventDispatchThread.pumpOneEventForHierar chy(EventDispatchThread.java:242)
at
java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:163)
at
java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:157)
at
java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:110)
Exception in thread "AWT-EventQueue-1" java.lang.NullPointerException
at
javax.swing.plaf.synth.SynthToolTipUI.getPreferred Size(SynthToolTipUI.java:139)
at javax.swing.JComponent.getPreferredSize(JComponent .java:1615)
at javax.swing.ToolTipManager.showTipWindow(ToolTipMa nager.java:233)
at javax.swing.ToolTipManager.mouseMoved(ToolTipManag er.java:591)
at
java.awt.AWTEventMulticaster.mouseMoved(AWTEventMu lticaster.java:272)
at java.awt.Component.processMouseMotionEvent(Compone nt.java:5533)
at
javax.swing.JComponent.processMouseMotionEvent(JCo mponent.java:3144)
at java.awt.Component.processEvent(Component.java:525 7)
at java.awt.Container.processEvent(Container.java:196 6)
at java.awt.Component.dispatchEventImpl(Component.jav a:3955)
at java.awt.Container.dispatchEventImpl(Container.jav a:2024)
at java.awt.Component.dispatchEvent(Component.java:38 03)
at
java.awt.LightweightDispatcher.retargetMouseEvent( Container.java:4212)
at
java.awt.LightweightDispatcher.processMouseEvent(C ontainer.java:3905)
at java.awt.LightweightDispatcher.dispatchEvent(Conta iner.java:3822)
at java.awt.Container.dispatchEventImpl(Container.jav a:2010)
at java.awt.Component.dispatchEvent(Component.java:38 03)
at java.awt.EventQueue.dispatchEvent(EventQueue.java: 463)
at
java.awt.EventDispatchThread.pumpOneEventForHierar chy(EventDispatchThread.java:242)
at
java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:163)
at
java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:157)
at
java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThre ad.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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Synth Look and Feel button size problem hogcia Java 0 04-17-2009 01:18 PM
How could I add a tooltip to an iframe ? Also, the tooltip contents has to be determine @ run-time ! Radu ASP .Net 1 01-08-2007 04:11 PM
Synth L&F as jar derharri@web.de Java 2 08-15-2006 11:46 AM
how to access arrowbuttons in synth l&f lesterpsigal@yahoo.de Java 0 12-19-2005 03:40 PM
If a synth is not "Creative Music Synth [220]" Lover of SB16's FM synth Digital Photography 0 10-19-2004 04:54 AM



Advertisments