coins = new JPanel();
coins.setLayout(new GridLayout(0,1));
ImageIcon tenP1 = new ImageIcon("10p.jpeg");
tenP = new JButton("", tenP1);
ImageIcon twentyP1 = new ImageIcon("20p.jpeg");
twentyP = new JButton("", twentyP1);
ImageIcon fiftyP1 = new ImageIcon("50p.jpeg");
fiftyP = new JButton("", fiftyP1);
ImageIcon pound = new ImageIcon("pound.jpeg");
onePound = new JButton("", pound);
我的图片图标不显示,我有他们在同一目录中同名吗?请帮助java imageicon和框架
香港专业教育学院将他们添加到面板和容器,但只显示noral按钮 – user1106130 2011-12-21 14:04:31
我想你应该thisto例如TRU您的ImageIcon:[代码] ImageIcon img = new ImageIcon(this.getClass()。getRessource(“/ img.png”)); – 2011-12-21 14:21:39
好的感谢任何想法如何使用之间的运算符switch语句中的情况下,例如case((小时> = 0)&&(小时<2)):amount = 0.50将工作 – user1106130 2011-12-21 14:44:57