at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:840)
at java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:815)
at java.desktop/javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:764)
at java.desktop/javax.swing.RepaintManager.access$1200(RepaintManager.java:69)
at java.desktop/javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1880)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
at java.desktop/java.awt.EventQueue.access$500(EventQueue.java:97)
at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:717)
at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:711)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:89)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:199)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at org.jb2011.lnf.beautyeye.ch1_titlepane.BETitlePane.paintComponent(BETitlePane.java:1018)
at java.desktop/javax.swing.JComponent.paint(JComponent.java:1075)
at java.desktop/javax.swing.JComponent.paintChildren(JComponent.java:908)
at java.desktop/javax.swing.JComponent.paint(JComponent.java:1084)
主类的声明:public class CardLayoutDemo extends JFrame implements ActionListener {
public JPanel pane = null;
public JPanel p = null;
public JPanel pbt = null;
public JPanel pan,pan1 = null;
public CardLayout card = null;
public JPanel p_1=null,p_2=null,p_3=null,p_4=null,p_5=null,p_6=null,p_7=null,
p_12=null,p_22=null,p_32=null,p_42=null,p_52=null,p_62=null,p_72=null;
构造器里的CardLayout:
card = new CardLayout(0,0);
pane = new JPanel(card);
p = new JPanel();
pbt = new JPanel(card);
pan = new JPanel();
pan1 = new JPanel();
p_1 = new JPanel();
p_1.setLayout(new FlowLayout());
p_2 = new JPanel();
p_2.setLayout(new BorderLayout());
p_3 = new JPanel();
p_3.setLayout(new BorderLayout());
p_4 = new JPanel();
p_5 = new JPanel();
p_5.setLayout(new BorderLayout());