Hi everyone,
My app need to manipulate JLabels that have been added to the pane. All I need to do is simple stuff like make them disappear or change their background color.
Unfortunately (and only from time to time) I get null pointer exceptions:
java.lang.NullPointerException
at javax.swing.text.JTextComponent.getSelectionStart( JTextComponent.java:1503)
at javax.swing.text.WrappedPlainView.paint(WrappedPla inView.java:342)
at javax.swing.plaf.basic.BasicTextUI$RootView.paint( BasicTextUI.java:1319)
at javax.swing.plaf.basic.BasicTextUI.paintSafely(Bas icTextUI.java:636)
at javax.swing.plaf.basic.BasicTextUI.paint(BasicText UI.java:770)
at javax.swing.plaf.basic.BasicTextUI.update(BasicTex tUI.java:749)
at javax.swing.JComponent.paintComponent(JComponent.j ava:541)
at javax.swing.JComponent.paint(JComponent.java:808)
at javax.swing.JComponent.paintChildren(JComponent.ja va:647)
at javax.swing.JComponent.paint(JComponent.java:817)
at javax.swing.JLayeredPane.paint(JLayeredPane.java:5 57)
As you can see, the stack trace doesn't point to any lines in my code but to the swing libraries instead.
Please help!
Thanks,
James