这个JAVA拼图游戏的代码该怎样改?

importjava.awt.Font;importjava.awt.event.ComponentAdapter;importjava.awt.event.Compon... import java.awt.Font;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.DefaultComboBoxModel;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.border.LineBorder;

public class puzzle extends JFrame implements MouseListener,KeyListener{

private static final long serialVersionUID = 1L;
private JList listResult;
private JPanel panMain;
private JPanel panGame;
private JPanel panRight;
private DefaultComboBoxModel dcbm;

private JTextField txtCount;
private JTextField txtLevel;

private JLabel [][] labels;

private final int MAX_LEVEL = 10;
private int[][] nums;
private int level;
private long clickCount = 0L;

/**
* Create the frame
*/
public puzzle() {
super();
addComponentListener(new ComponentAdapter() {
public void componentResized(final ComponentEvent e) {
JFrame jf = (JFrame)e.getSource();
if(jf.getHeight()<400) jf.setSize(jf.getWidth(),400);
if(jf.getWidth()<600) jf.setSize(600,jf.getHeight());
panRight.setBounds(jf.getWidth()-panRight.getWidth()-10,10,panRight.getWidth(),jf.getContentPane().getHeight()-20);
panGame.setBounds(10,10,jf.getWidth()-panRight.getWidth()-30,jf.getContentPane().getHeight()-20);
listResult.setSize(listResult.getWidth(), panRight.getHeight()-listResult.getY()-10);
}
});
setName("frmMain");
setTitle("拼图");
setBounds(100, 100, 579, 438);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

panMain = new JPanel();
panMain.setLayout(null);
getContentPane().add(panMain, BorderLayout.CENTER);

panGame = new JPanel();
panGame.setLayout(null);
panGame.setBounds(10, 10, 358, 385);
panMain.add(panGame);

panRight = new JPanel();
panRight.setBackground(Color.CYAN);
panRight.setLayout(null);
panRight.setBounds(374, 10, 187, 385);
panMain.add(panRight);

txtLevel = new JTextField();
txtLevel.setText("3");
txtLevel.setBounds(62, 43, 87, 22);
panRight.add(txtLevel);

final JLabel label = new JLabel();
label.setText("难度:");
label.setBounds(10, 45, 39, 18);
panRight.add(label);

final JButton btnStart = new JButton();
btnStart.addMouseListener(new MouseAdapter() {
public void mouseReleased(final MouseEvent e) {
newGame();
}
});
btnStart.setText("开始");
btnStart.setBounds(10, 95, 73, 22);
panRight.add(btnStart);

final JLabel labCount = new JLabel();
labCount.setText("移动次数:");
labCount.setBounds(10, 176, 39, 18);
panRight.add(labCount);

txtCount = new JTextField();
txtCount.setBounds(62, 174, 87, 22);
额,这个代码太长了发不出来。。。
算了
展开
 我来答
bellCliff
2010-06-18 · TA获得超过650个赞
知道小有建树答主
回答量:820
采纳率:0%
帮助的人:611万
展开全部
想要答案,加分,然后hi给我源码,帮你搞定
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
jxnktjlfr
2010-06-18 · TA获得超过112个赞
知道小有建树答主
回答量:92
采纳率:0%
帮助的人:114万
展开全部
你要我们改什么,有什么问题呢?
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式