Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: nullPointerException with Nimbus l&f

  1. #1
    Junior Member
    Join Date
    Feb 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default nullPointerException with Nimbus l&f

    Hello !
    I've been searching everywhere for the following exception, but still don't find the answer. Please help !
    I'm using Nimbus Look and Feel, and I get follow exception (GTKLookAndFeel has the same problem, whereas Metal, MotifLookAndFeel work well) :

    Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    at javax.swing.plaf.synth.SynthTableUI.paintCell(Synt hTableUI.java:625)
    at javax.swing.plaf.synth.SynthTableUI.paintCells(Syn thTableUI.java:521)
    at javax.swing.plaf.synth.SynthTableUI.paint(SynthTab leUI.java:305)
    at javax.swing.plaf.synth.SynthTableUI.update(SynthTa bleUI.java:234)
    at javax.swing.JComponent.paintComponent(JComponent.j ava:752)
    at javax.swing.JComponent.paint(JComponent.java:1029)
    at javax.swing.JComponent.paintChildren(JComponent.ja va:862)
    at javax.swing.JComponent.paint(JComponent.java:1038)
    at javax.swing.JViewport.paint(JViewport.java:747)
    at javax.swing.JComponent.paintChildren(JComponent.ja va:862)
    at javax.swing.JComponent.paint(JComponent.java:1038)
    at javax.swing.JComponent.paintChildren(JComponent.ja va:862)
    at javax.swing.JSplitPane.paintChildren(JSplitPane.ja va:1030)
    at javax.swing.JComponent.paint(JComponent.java:1038)
    at javax.swing.JComponent.paintChildren(JComponent.ja va:862)
    at javax.swing.JComponent.paint(JComponent.java:1038)
    at javax.swing.JComponent.paintChildren(JComponent.ja va:862)
    at javax.swing.JComponent.paint(JComponent.java:1038)
    at javax.swing.JLayeredPane.paint(JLayeredPane.java:5 67)
    at javax.swing.JComponent.paintChildren(JComponent.ja va:862)
    at javax.swing.JComponent.paint(JComponent.java:1038)
    at javax.swing.JComponent.paintChildren(JComponent.ja va:862)
    at javax.swing.JComponent.paint(JComponent.java:1038)
    at javax.swing.JComponent.paintChildren(JComponent.ja va:862)
    at javax.swing.JComponent.paint(JComponent.java:1038)
    at javax.swing.JLayeredPane.paint(JLayeredPane.java:5 67)
    at javax.swing.JComponent.paintChildren(JComponent.ja va:862)
    at javax.swing.JComponent.paint(JComponent.java:1038)
    at javax.swing.JLayeredPane.paint(JLayeredPane.java:5 67)
    at javax.swing.JComponent.paintChildren(JComponent.ja va:862)
    at javax.swing.JComponent.paintToOffscreen(JComponent .java:5131)
    at javax.swing.BufferStrategyPaintManager.paint(Buffe rStrategyPaintManager.java:278)
    at javax.swing.RepaintManager.paint(RepaintManager.ja va:1224)
    at javax.swing.JComponent.paint(JComponent.java:1015)
    at java.awt.GraphicsCallback$PaintCallback.run(Graphi csCallback.java:21)
    at sun.awt.SunGraphicsCallback.runOneComponent(SunGra phicsCallback.java:60)
    at sun.awt.SunGraphicsCallback.runComponents(SunGraph icsCallback.java:97)
    at java.awt.Container.paint(Container.java:1780)
    at java.awt.Window.paint(Window.java:3375)
    at javax.swing.RepaintManager.paintDirtyRegions(Repai ntManager.java:796)
    at javax.swing.RepaintManager.paintDirtyRegions(Repai ntManager.java:713)
    at javax.swing.RepaintManager.seqPaintDirtyRegions(Re paintManager.java:693)
    at javax.swing.SystemEventQueueUtilities$ComponentWor kRequest.run(SystemEventQueueUtilities.java:125)
    at java.awt.event.InvocationEvent.dispatch(Invocation Event.java:209)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.j ava:641)
    at java.awt.EventQueue.access$000(EventQueue.java:84)
    at java.awt.EventQueue$1.run(EventQueue.java:602)
    at java.awt.EventQueue$1.run(EventQueue.java:600)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectio nPrivilege(AccessControlContext.java:87)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java: 611)
    at java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:122)

    I've tried :
    - add SwingWorker thread for the long process
    - call UIManger.setLookAndFeel("com.sun.java.swing.plaf.n imbus.NimbusLookAndFeel") after initialize my Frame
    - add :
    EventQueue queue = Toolkit.getDefaultToolkit().getSystemEventQueue();
    queue.push(new EventQueue() {
    @Override
    protected void dispatchEvent(AWTEvent event) {
    try {
    super.dispatchEvent(event);
    } catch (Throwable t) {
    System.out.println(super.getCurrentEvent());
    System.out.println(event.getSource());
    t.printStackTrace();
    System.out.println(t.getMessage() );
    }
    }
    });
    and I get java.awt.event.InvocationEvent[INVOCATION_DEFAULT,runnable=javax.swing.SystemEven tQueueUtilities$ComponentWorkRequest@64959a7a,noti fier=null,catchExceptions=false,when=1360338783958] on sun.awt.X11.XToolkit@472462b3
    java.lang.NullPointerException
    sun.awt.X11.XToolkit@472462b3
    null

    Someone can help me ?


  2. #2
    Super Moderator curmudgeon's Avatar
    Join Date
    Aug 2012
    Posts
    1,130
    My Mood
    Cynical
    Thanks
    64
    Thanked 140 Times in 135 Posts

    Default Re: nullPointerException with Nimbus l&f

    Are you sure that you're scrupulously careful to start *all* Swing code on the event dispatch thread, including the code that creates and displays the application? Try creating a minimal example that reproduces this problem so that we can test and modify it, an SSCCE.

  3. #3
    Junior Member
    Join Date
    Feb 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: nullPointerException with Nimbus l&f

    Hello ! I've tried to put some lines, but apparently, I can't post it. Never mind, I've find an object is not created correctly in a librery.
    Thank you curmudgeon !

Similar Threads

  1. Replies: 0
    Last Post: November 16th, 2011, 08:29 AM
  2. How to make these beautiful JPanels for Nimbus look and feel ?
    By Sarabjeet Singh in forum AWT / Java Swing
    Replies: 1
    Last Post: June 10th, 2011, 05:13 PM
  3. Bold font in JTabbedpane in Nimbus L&F
    By sponarun in forum What's Wrong With My Code?
    Replies: 0
    Last Post: February 28th, 2011, 02:09 AM
  4. JTable gridlines not showing in a nimbus L&F
    By chronoz13 in forum AWT / Java Swing
    Replies: 0
    Last Post: February 22nd, 2010, 07:45 AM