一个关于swing的问题!! JButton jButton1 = new JButton();这里你重新定义了一个jButton1 ,覆盖了全局变量jButton1 ,所以把JButton 去掉就可以了。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 NullPointerException你看看哪里是不是有组件没有 new 就加载显示了 同理,好象你还有很多这样的情况JRadioButton jRadioButton1 = new JRadioButton(); JRadioButton jRadioButton2 = new JRadioButton(); JRadioButton jRadioButton3 = new JRadioButton(); JRadioButton jRadioButton4 = new JRadioButton(); JRadioButton jRadioButton5 = new JRadioButton(); JRadioButton jRadioButton6 = new JRadioButton(); JRadioButton jRadioButton7 = new JRadioButton(); JRadioButton jRadioButton8 = new JRadioButton(); JRadioButton jRadioButton9 = new JRadioButton(); JRadioButton jRadioButton10 = new JRadioButton(); JRadioButton jRadioButton11 = new JRadioButton(); JRadioButton jRadioButton12 = new JRadioButton();都是重新定义了局部变量从而隐藏了全局变量。把JRadioButton 都去掉。 一个关于监听JTextField内容的问题 小弟跪求解决了 谢谢 如何覆盖toString方法 jdk正确安装,path,classpath设置正确,为何编译HelloWorld.java还是出错,高手指点! 请问怎么在界面中嵌入播放器? 请问一下,如何反-反编译呢? 在线急等,关于java的取位 我想学JAVA“需要”补习点什么? !!!版主快来管管吧《JAVA初学者必读-经验总结》有大问题 菜鸟学JAVA问题之二 JBUILDER 5 入门问题. 初学者求助! 何处可以下载JDBC-ODBC bridge
JRadioButton jRadioButton1 = new JRadioButton();
JRadioButton jRadioButton2 = new JRadioButton();
JRadioButton jRadioButton3 = new JRadioButton();
JRadioButton jRadioButton4 = new JRadioButton();
JRadioButton jRadioButton5 = new JRadioButton();
JRadioButton jRadioButton6 = new JRadioButton();
JRadioButton jRadioButton7 = new JRadioButton();
JRadioButton jRadioButton8 = new JRadioButton();
JRadioButton jRadioButton9 = new JRadioButton();
JRadioButton jRadioButton10 = new JRadioButton();
JRadioButton jRadioButton11 = new JRadioButton();
JRadioButton jRadioButton12 = new JRadioButton();都是重新定义了局部变量从而隐藏了全局变量。把JRadioButton 都去掉。