Search Results

Search found 3 results on 1 pages for 'jtextcomponent'.

Page 1/1 | 1 

  • NullPointerException in javax.swing.text.SimpleAttributeSet.addAttribute

    - by Paul Reiners
    Has anyone ever seen an exception like this?: ERROR: java.lang.NullPointerException: null at java.util.Hashtable.put(null:-1) at javax.swing.text.SimpleAttributeSet.addAttribute(null:-1) at javax.swing.text.SimpleAttributeSet.addAttributes(null:-1) at javax.swing.text.StyledEditorKit.createInputAttributes(null:-1) at javax.swing.text.StyledEditorKit$AttributeTracker.updateInputAttributes(null:-1) at javax.swing.text.StyledEditorKit$AttributeTracker.caretUpdate(null:-1) at javax.swing.text.JTextComponent.fireCaretUpdate(null:-1) at javax.swing.text.JTextComponent$MutableCaretEvent.fire(null:-1) at javax.swing.text.JTextComponent$MutableCaretEvent.mouseReleased(null:-1) at java.awt.AWTEventMulticaster.mouseReleased(null:-1) at java.awt.AWTEventMulticaster.mouseReleased(null:-1) at java.awt.Component.processMouseEvent(null:-1) at javax.swing.JComponent.processMouseEvent(null:-1) at java.awt.Component.processEvent(null:-1) at java.awt.Container.processEvent(null:-1) at java.awt.Component.dispatchEventImpl(null:-1) at java.awt.Container.dispatchEventImpl(null:-1) at java.awt.Component.dispatchEvent(null:-1) at java.awt.LightweightDispatcher.retargetMouseEvent(null:-1) at java.awt.LightweightDispatcher.processMouseEvent(null:-1) at java.awt.LightweightDispatcher.dispatchEvent(null:-1) at java.awt.Container.dispatchEventImpl(null:-1) at java.awt.Window.dispatchEventImpl(null:-1) at java.awt.Component.dispatchEvent(null:-1) at java.awt.EventQueue.dispatchEvent(null:-1) at java.awt.EventDispatchThread.pumpOneEventForFilters(null:-1) at java.awt.EventDispatchThread.pumpEventsForFilter(null:-1) at java.awt.EventDispatchThread.pumpEventsForHierarchy(null:-1) at java.awt.EventDispatchThread.pumpEvents(null:-1) at java.awt.EventDispatchThread.pumpEvents(null:-1) at java.awt.EventDispatchThread.run(null:-1) I wish I could tell you an easy way to reproduce this, but I can’t. It’s happening in a Java Swing application I maintain. It happens infrequently and the application is quite complex. I know it’s a bit of a long shot just showing this stack trace, but I thought I’d try.

    Read the article

  • Synth LaF JLabel DISABLED color

    - by mmoris
    Hi all, Using the Synth LaF, I am unable to set a JLabel's FOREGROUND color for the DISABLED state. has anybody succeeded in doing this? Here is my label's style definition in my LaF.xml file. <style id="whiteLabelStyle"> <opaque value="false"/> <font name="Bitstream Vera Sans" size="16" /> <state> <color type="FOREGROUND" value="WHITE"/> </state> <state value="DISABLED"> <color type="FOREGROUND" value="BLACK"/> </state> </style> <bind style="whiteLabelStyle" type="name" key="WhiteOrbitLabel"/> Please not that all the other styles defined in my LaF.xml file are rendered properly in my application including my label's WHITE normal state color (it just never goes to black when I do lbl.setEnabled(false) Also, going through the Synth code, I have found the following comment in SynthStyle.getColor if ((context.getComponentState() & SynthConstants.DISABLED) != 0) { //This component is disabled, so return the disabled color. //In some cases this means ignoring the color specified by the //developer on the component. In other cases it means using a //specified disabledTextColor, such as on JTextComponents. //For example, JLabel doesn't specify a disabled color that the //developer can set, yet it should have a disabled color to the //text when the label is disabled. This code allows for that. if (c instanceof JTextComponent) { JTextComponent txt = (JTextComponent)c; Color disabledColor = txt.getDisabledTextColor(); if (disabledColor == null || disabledColor instanceof UIResource) { return getColorForState(context, type); } } else if (c instanceof JLabel && (type == ColorType.FOREGROUND || type == ColorType.TEXT_FOREGROUND)){ return getColorForState(context, type); } But I could not figure out how to set a disabled color for a JLabel Thanks for your help!

    Read the article

1