引用:JackJiang 发表于 2018-06-16 09:02 JDK9.0 我看了一下API文档,也许是我没有建立awt 的Framed导致的吗。。一直不太会用JAVA 的Graphics等会看看文档。。然后我的声明好像也不太规范。。图片好像上传失败了。。不知道加那个首页群能不能联系到大神。。 主类的声明: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()); |
你是java什么版本? 另外,读一下BeautyEye源码:“at org.jb2011.lnf.beautyeye.ch1_titlepane.BETitlePane.paintComponent(BETitlePane.java:1018)”,1018行! |