java 打字游戏项目

更新时间:2023-10-03 22:48:01 阅读量: 综合文库 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

import java.util.Calendar; import javax.swing.*;

import java.awt.*;

import java.awt.event.*; import java.io.*;

import java.util.Hashtable;

public class TypegameFrame extends JFrame implements Runnable {

JPanel leftPanel,rightPanel; JLabel zms,l2,l3,l4,zm; JButton b1,b2,b3;

int x,y,a[];

Icon icon=new ImageIcon(\

public TypegameFrame(String s){ super(\打字游戏\

this.setLayout( null);

leftPanel=new JPanel(); this.add(leftPanel);

leftPanel.setLayout(null);

leftPanel.setBounds(5,3,400,400);

leftPanel.setBackground(Color.WHITE); zm = new JLabel(\ zm.setIcon(icon);

Icon icon[]=new Icon[26]; for(int i=0;i

icon[i]=new ImageIcon(\}

leftPanel.add(zm);

zm.setSize(50,100);

zm.setLocation(200,100); rightPanel = new JPanel(); rightPanel.setLayout(null); this.add(rightPanel);

rightPanel.setBackground(Color.WHITE); rightPanel.setBounds(410,3,140,400); b1 = new JButton(\开始游戏\ b2 = new JButton(\结束游戏\ b3 = new JButton(\退出程序\

}

public static void main(String[] args) { }

TypegameFrame t= new TypegameFrame(null); t.run();

Thread Thread = new Thread();

本文来源:https://www.bwwdw.com/article/jzbd.html

Top