I create a JTabbedPane in a JFrame using netbeans visual creator. And build a JPanel also. When I add that JPanel as a tab I got the following error. Sometimes it doesn't occur.
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at com.sun.java.swing.plaf.windows.WindowsTabbedPaneUI.paintContentBorder(WindowsTabbedPaneUI.java:145)
at javax.swing.plaf.basic.BasicTabbedPaneUI.paint(BasicTabbedPaneUI.java:791)
at javax.swing.plaf.ComponentUI.update(ComponentUI.java:161)
at javax.swing.JComponent.paintComponent(JComponent.java:778)
at javax.swing.JComponent.paint(JComponent.java:1054)
at javax.swing.JComponent.paintChildren(JComponent.java:887)
at javax.swing.JComponent.paint(JComponent.java:1063)
at javax.swing.JComponent.paintToOffscreen(JComponent.java:5219)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1529)
at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1452)
at javax.swing.RepaintManager.paint(RepaintManager.java:1249)
at javax.swing.JComponent._paintImmediately(JComponent.java:5167)
at javax.swing.JComponent.paintImmediately(JComponent.java:4978)
at javax.swing.RepaintManager$3.run(RepaintManager.java:808)
at javax.swing.RepaintManager$3.run(RepaintManager.java:796)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:796)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:769)
at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:718)
at javax.swing.RepaintManager.access$1100(RepaintManager.java:62)
at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1677)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
This is the code to add JPanel as a Tab.
jTabbedPane2.addTab("Swimmer",new SwimmerPanel());
What is the error?
You probably didn't initialized the JTabbedPane :
JTabbedPane jTabbedPane2 = new JTabbedPane();
Related
I want to display a file (pdf file or image file) in my frame.
I tried to work with JWebBrowser but i have got exceptions.
Here is my code :
JWebBrowser fileBrowser = new JWebBrowser();
fileBrowser.setBarsVisible(false);
fileBrowser.setStatusBarVisible(false);
jPanel2.add(fileBrowser, BorderLayout.CENTER);
//fileBrowser.navigate("file:///C:/Users/HP/Desktop/a.pdf");
fileBrowser.navigate("C:\\Users\\HP\\Desktop\\icon5.jpg");
I got this exception :
Exception in thread "AWT-EventQueue-0" java.lang.ExceptionInInitializerError
at z.zz.createBrowser(zz.java:67)
at z.zz.<init>(zz.java:43)
at z.zz$2.run(zz.java:239)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Caused by:java.lang.RuntimeException: java.lang.ClassNotFoundException: chrriis.dj.nativeswing.swtimpl.components.core.NativeWebBrowserStatic
at chrriis.dj.nativeswing.swtimpl.internal.NativeCoreObjectFactory.create(NativeCoreObjectFactory.java:42)
at chrriis.dj.nativeswing.swtimpl.components.JWebBrowser.<clinit>(JWebBrowser.java:115)
... 17 more Caused by: java.lang.ClassNotFoundException: chrriis.dj.nativeswing.swtimpl.components.core.NativeWebBrowserStatic
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at chrriis.dj.nativeswing.swtimpl.internal.NativeCoreObjectFactory.create(NativeCoreObjectFactory.java:35)
... 18 more
I am new to pentaho. I am using Pentaho Report Desiner ce-5.3.0 on Windows 7 32 bit.
When I try to publish report then login window popup then filling all fields and click on ok, it gives error.
Unable to publish your file
please try again or contact to your system administrator for assistance.
Then I have following message in error window.
Internal error occure
java.lang.RuntimeException: org.pentaho.reporting.designer.extensions.pentaho.repository.util.PublishException: The File exists and override has not been specified.
at org.pentaho.reporting.designer.extensions.pentaho.repository.actions.UpdateReservedCharsTask.run(UpdateReservedCharsTask.java:90)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:154)
at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
at java.awt.Dialog.show(Dialog.java:1082)
at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:870)
at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:667)
at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:638)
at org.pentaho.reporting.designer.extensions.pentaho.repository.actions.PublishToServerTask.showErrorMessage(PublishToServerTask.java:170)
at org.pentaho.reporting.designer.extensions.pentaho.repository.actions.PublishToServerTask.run(PublishToServerTask.java:105)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:703)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Caused by: org.pentaho.reporting.designer.extensions.pentaho.repository.util.PublishException: The File exists and override has not been specified.
at org.pentaho.reporting.designer.extensions.pentaho.repository.actions.UpdateReservedCharsTask.run(UpdateReservedCharsTask.java:84)
... 35 more
The version of Report designer and bi server should be same. try that and post the result.
The error says the file already exists. You must either delete the file beforehand or check the "overwrite" checkbox.
Since going to 1.7.0_45 (and 51) my program sometimes hangs. All of it's windows work OK except for one, it's fairly complex and has around 60 JButtons, JTextFields, two JScrollbars, JLabels etc. But so do all my other windows and they work fine.
I've put debug lines to the console so I can see where the program is hanging and it seems to be during the repaint() fn. It's hanging at the line
Graphics g = getGraphics();
It has managed to draw some stuff to the screen so it's not the first call to repaint that's the issue. Looks like this: http://www.unixnerd.demon.co.uk/hungjava.jpg
I get this StackTrace. None of the lines of code are in my program. It only happens maybe one time in ten if I open and close the window. Never had the issue with Java 1.6.x. Happens on a few PCs (all Windows 7), not just mine.
Grateful for any ideas.
Exception in thread "AWT-EventQueue-1" java.lang.NullPointerException
at javax.swing.LayoutComparator.compare(LayoutComparator.java:116)
at javax.swing.LayoutComparator.compare(LayoutComparator.java:42)
at java.util.TimSort.countRunAndMakeAscending(TimSort.java:329)
at java.util.TimSort.sort(TimSort.java:189)
at java.util.TimSort.sort(TimSort.java:173)
at java.util.Arrays.sort(Arrays.java:659)
at java.util.Collections.sort(Collections.java:217)
at javax.swing.SortingFocusTraversalPolicy.enumerateAndSortCycle(SortingFocusTraversalPolicy.java:136)
at javax.swing.SortingFocusTraversalPolicy.getFocusTraversalCycle(SortingFocusTraversalPolicy.java:110)
at javax.swing.SortingFocusTraversalPolicy.getFirstComponent(SortingFocusTraversalPolicy.java:435)
at javax.swing.LayoutFocusTraversalPolicy.getFirstComponent(LayoutFocusTraversalPolicy.java:166)
at javax.swing.SortingFocusTraversalPolicy.getDefaultComponent(SortingFocusTraversalPolicy.java:515)
at java.awt.FocusTraversalPolicy.getInitialComponent(FocusTraversalPolicy.java:169)
at java.awt.Window.getMostRecentFocusOwner(Window.java:2317)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:681)
at java.awt.Component.dispatchEventImpl(Component.java:4731)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:735)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:708)
at java.awt.EventQueue$4.run(EventQueue.java:706)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
at java.awt.SequencedEvent.dispatch(SequencedEvent.java:128)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:694)
at java.awt.EventQueue$3.run(EventQueue.java:692)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:708)
at java.awt.EventQueue$4.run(EventQueue.java:706)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:705)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
I'm devloping a java program using netbeans
I added a look and feel to GUI application which is Synthetica AluOxide Look and Feel from this website : http://www.javasoft.de/synthetica/themes/ .
I added the Synthetica.jar and syntheticaAluOxide.jar using Add Jar/Folder dialog o my project Libraries.
and then I added this code to my class load :
import de.javasoft.plaf.synthetica.SyntheticaAluOxideLookAndFeel;
.
.
.
try
{
UIManager.setLookAndFeel(new SyntheticaAluOxideLookAndFeel());
}
catch (Exception e)
{
e.printStackTrace();
}
but when I run my application I don't get any changes, and I get this error when I click on some component in my application :
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at
sun.font.FontDesignMetrics$MetricsKey.init(FontDesignMetrics.java:217)
at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:286)
at
sun.swing.SwingUtilities2.getFontMetrics(SwingUtilities2.java:1003)
at javax.swing.JComponent.getFontMetrics(JComponent.java:1615) at
sun.swing.MenuItemLayoutHelper.reset(MenuItemLayoutHelper.java:125)
at
javax.swing.plaf.synth.SynthMenuItemLayoutHelper.(SynthMenuItemLayoutHelper.java:119)
at
javax.swing.plaf.synth.SynthGraphicsUtils.paint(SynthGraphicsUtils.java:498)
at javax.swing.plaf.synth.SynthMenuUI.paint(SynthMenuUI.java:283) at
javax.swing.plaf.synth.SynthMenuUI.update(SynthMenuUI.java:248) at
javax.swing.JComponent.paintComponent(JComponent.java:769) at
javax.swing.JComponent.paint(JComponent.java:1045) at
javax.swing.JComponent.paintChildren(JComponent.java:878) at
javax.swing.JComponent.paint(JComponent.java:1054) at
javax.swing.JComponent.paintChildren(JComponent.java:878) at
javax.swing.JComponent.paint(JComponent.java:1054) at
javax.swing.JLayeredPane.paint(JLayeredPane.java:585) at
javax.swing.JComponent.paintChildren(JComponent.java:878) at
javax.swing.JComponent.paint(JComponent.java:1054) at
javax.swing.JComponent.paintToOffscreen(JComponent.java:5212) at
javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:295)
at javax.swing.RepaintManager.paint(RepaintManager.java:1236) at
javax.swing.JComponent._paintImmediately(JComponent.java:5160) at
javax.swing.JComponent.paintImmediately(JComponent.java:4971) at
javax.swing.RepaintManager$3.run(RepaintManager.java:796) at
javax.swing.RepaintManager$3.run(RepaintManager.java:784) at
java.security.AccessController.doPrivileged(Native Method) at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at
javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:784)
at
javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:757)
at
javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:706)
at javax.swing.RepaintManager.access$1000(RepaintManager.java:62) at
javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1651)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:727) at
java.awt.EventQueue.access$200(EventQueue.java:103) at
java.awt.EventQueue$3.run(EventQueue.java:688) at
java.awt.EventQueue$3.run(EventQueue.java:686) at
java.security.AccessController.doPrivileged(Native Method) at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:697) at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at
sun.font.FontDesignMetrics$MetricsKey.init(FontDesignMetrics.java:217)
at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:286)
at
sun.swing.SwingUtilities2.getFontMetrics(SwingUtilities2.java:1003)
at javax.swing.JComponent.getFontMetrics(JComponent.java:1615) at
sun.swing.MenuItemLayoutHelper.reset(MenuItemLayoutHelper.java:126)
at
javax.swing.plaf.synth.SynthMenuItemLayoutHelper.(SynthMenuItemLayoutHelper.java:119)
at
javax.swing.plaf.synth.SynthGraphicsUtils.paint(SynthGraphicsUtils.java:498)
at
javax.swing.plaf.synth.SynthMenuItemUI.paint(SynthMenuItemUI.java:283)
at
javax.swing.plaf.synth.SynthMenuItemUI.update(SynthMenuItemUI.java:247)
at javax.swing.JComponent.paintComponent(JComponent.java:769) at
javax.swing.JComponent.paint(JComponent.java:1045) at
javax.swing.JComponent.paintChildren(JComponent.java:878) at
javax.swing.JComponent.paint(JComponent.java:1054) at
javax.swing.JComponent.paintToOffscreen(JComponent.java:5212) at
javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1512)
at
javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1443)
at
javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:311)
at javax.swing.RepaintManager.paint(RepaintManager.java:1236) at
javax.swing.JComponent._paintImmediately(JComponent.java:5160) at
javax.swing.JComponent.paintImmediately(JComponent.java:4971) at
javax.swing.RepaintManager$3.run(RepaintManager.java:796) at
javax.swing.RepaintManager$3.run(RepaintManager.java:784) at
java.security.AccessController.doPrivileged(Native Method) at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at
javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:784)
at
javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:757)
at
javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:706)
at javax.swing.RepaintManager.access$1000(RepaintManager.java:62) at
javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1651)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:251)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:727) at
java.awt.EventQueue.access$200(EventQueue.java:103) at
java.awt.EventQueue$3.run(EventQueue.java:688) at
java.awt.EventQueue$3.run(EventQueue.java:686) at
java.security.AccessController.doPrivileged(Native Method) at
java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:697) at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Did you include Synthetica's core library 'synthetica.jar'
Ensure that your classpath contains all Synthetica libraries (including
Synthetica's core library 'synthetica.jar').
Enable the Synthetica Look and Feel at startup time in your application:
import de.javasoft.plaf.synthetica.SyntheticaClassyLookAndFeel;
try {
UIManager.setLookAndFeel(new SyntheticaClassyLookAndFeel());
} catch (Exception e) {
e.printStackTrace();
}
I have a NullPointerException that I don't understand. Usually, the console points to a line in my code when this happens. This time, it's pointing to
at javax.swing.plaf.synth.SynthLabelUI.getPreferredSize(SynthLabelUI.java:238)
which as far as I understand, is not in my code. Would someone please explain to me what's going on?
Exception in thread "AWT-EventQueue-1" java.lang.NullPointerException
at javax.swing.plaf.synth.SynthLabelUI.getPreferredSize(SynthLabelUI.java:238)
at javax.swing.JComponent.getPreferredSize(JComponent.java:1660)
at javax.swing.plaf.basic.BasicSliderUI.getHeightOfTallestLabel(BasicSliderUI.java:775)
at javax.swing.plaf.synth.SynthSliderUI.layout(SynthSliderUI.java:378)
at javax.swing.plaf.synth.SynthSliderUI.calculateGeometry(SynthSliderUI.java:343)
at javax.swing.plaf.basic.BasicSliderUI$Handler.componentResized(BasicSliderUI.java:1496)
at java.awt.Component.processComponentEvent(Component.java:6331)
at java.awt.Component.processEvent(Component.java:6285)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:723)
at java.awt.EventQueue.access$200(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:682)
at java.awt.EventQueue$3.run(EventQueue.java:680)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:696)
at java.awt.EventQueue$4.run(EventQueue.java:694)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:693)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
I'm painting custom labels with
private void setSliderLabels() {
Dictionary<Integer, JLabel> table = new Hashtable<Integer, JLabel>();
table.put(-256, new JLabel("-w/2"));
table.put(-128, new JLabel("-w/4"));
table.put(0, new JLabel("0"));
table.put(128, new JLabel("w/4"));
table.put(256, new JLabel("w/2"));
LSlider.setLabelTable(table);
QSlider.setLabelTable(table);
}
This usually means that you violated the (implied or expressed) contract of the API you are using. For example calling a method with a null value that is not supposed to be called with null, or not setting some fields that ought to be set. If the API is not clear in that regard, this is often guesswork.