龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 软件开发 > JAVA开发 >

Java基于swing实现的弹球游戏代码(2)

时间:2014-11-14 11:08来源:网络整理 作者:网络 点击:
分享到:
public void actionPerformed(ActionEvent e) { String com = e.getActionCommand(); if (com.equals("暂停")) { button.setMargin(new Insets(0, 0, 0, 0)); button.setIcon(new javax.swing.ImageIcon("images/s

                        public void actionPerformed(ActionEvent e) {
                                String com = e.getActionCommand();

                                if (com.equals("暂停")) {
                                        button.setMargin(new Insets(0, 0, 0, 0));
                                        button.setIcon(new javax.swing.ImageIcon("images/start.gif"));
                                        button.setActionCommand("继续");
                                        for (int i = 0; i < list.size(); i++) {
                                                list.get(i).PauseThread();

                                        }

                                }
                                if (com.equals("继续")) {

                                        button.setMargin(new Insets(0, 0, 0, 0));
                                        button.setIcon(new javax.swing.ImageIcon("images/Pause.gif"));
                                        button.setActionCommand("暂停");

                                        for (int i = 0; i < list.size(); i++) {
                                                list.get(i).ContinueThread();
                                        }

                                }

                        }

精彩图集

赞助商链接