游戏添加统计,并且用文件保存读取消灭坦克的数量,添加菜单,点击新游戏会开始游戏
Test.java
~~~
package tkdz;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Test extends JFrame implements ActionListener{
MyPanel mp =null;
GuankaPanel gkmp=null;//关卡面板
JMenuBar cd=null;
JMenu cd1=null;
JMenuItem cdx1=null;
JMenuItem cdx2=null;
JMenuItem cdx3=null;
JMenuItem cdx4=null;
public static void main(String[] args){
Test t1 =new Test();
}
public Test(){
cd=new JMenuBar();
cd1=new JMenu("游戏(G)");
cd1.setMnemonic('G');
cdx1=new JMenuItem("新游戏(N)");
cdx2 =new JMenuItem("退出游戏(E)");
cdx3 =new JMenuItem("存盘退出(C)");
cdx4 =new JMenuItem("继续游戏(S)");
//mp =new MyPanel();//面板
//this.add(mp);
//this.addKeyListener(mp);//添加键盘监听
//Thread t=new Thread(mp);//多余吗?
//t.start();//多余吗?
cdx4.addActionListener(this);
cdx4.setActionCommand("goonGame");
cdx3.addActionListener(this);
cdx3.setActionCommand("saveExit");
cdx2.addActionListener(this);
cdx2.setActionCommand("exit");
cdx1.addActionListener(this);
cdx1.setActionCommand("newGame");
cd1.add(cdx1);
cd1.add(cdx2);
cd1.add(cdx3);
cd1.add(cdx4);
cd.add(cd1);
gkmp =new GuankaPanel();
Thread t=new Thread(gkmp);
t.start();//线程让字闪起来
this.setJMenuBar(cd);
this.add(gkmp);
this.setTitle("坦克大战");
this.setIconImage((new ImageIcon("tank.jpg")).getImage());
this.setSize(600,500);
this.setLocation(270, 170);
this.setResizable(false);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setVisible(true);
}
@Override
public void actionPerformed(ActionEvent e) {
if(e.getActionCommand().equals("newGame"))
{
mp=new MyPanel("newGame");//新游戏
this.remove(gkmp);//去掉以前的面板
this.add(mp);
this.addKeyListener(mp);
Thread t=new Thread(mp);
t.start();
this.setVisible(true);
}else if(e.getActionCommand().equals("goonGame"))
{
mp=new MyPanel("goonGame");//继续游戏
Thread t=new Thread(mp);
t.start();
this.remove(gkmp);
this.add(mp);
this.addKeyListener(mp);
this.setVisible(true);
}else if(e.getActionCommand().equals("saveExit"))
//存盘游戏
{
Jilu jl=new Jilu();
jl.setDtk(mp.dtk);
jl.cunpan();
System.exit(0);
}
//退出游戏
else if(e.getActionCommand().equals("exit"))
{
Jilu.bcjl();
System.exit(0);
}
}
}
~~~
Tank.java
~~~
package tkdz;
import java.io.*;
import java.util.*;
public class Tank {
int x=0,y=0;
int fangxiang=0;//方向
int sudu=5;//速度
int color;
boolean shengming=true;
public int getFangxiang() {
return fangxiang;
}
public void setFangxiang(int fangxiang) {
this.fangxiang = fangxiang;
}
public int getSudu() {
return sudu;
}
public void setSudu(int sudu) {
this.sudu = sudu;
}
public int getX() {
return x;
}
public void setX(int x) {
this.x = x;
}
public int getY() {
return y;
}
public void setY(int y) {
this.y = y;
}
public int getColor() {
return color;
}
public void setColor(int color) {
this.color = color;
}
public boolean isShengming() {
return shengming;
}
public void setShengming(boolean shengming) {
this.shengming = shengming;
}
public Tank(int x, int y) {
super();
this.x = x;
this.y = y;
}
}
class Baozha{
int x,y;
int shengcunqi=900;//生存期
boolean shengming=true;
public Baozha(int x,int y){
this.x=x;
this.y=y;
}
public void suqsd(){
if(shengcunqi>0){
shengcunqi--;
}else{
this.shengming=false;
}
}
}
class Jilu
{
private static int dtsl=10;
private static int mtsl=2;
private static int sdtj=0;
private static FileWriter fw=null;
private static BufferedWriter bw=null;
private static FileReader fr=null;
private static BufferedReader br=null;
private static Vector<DiTank> dtk=new Vector<DiTank>();
static Vector<Weizhi> wzjh=new Vector<Weizhi>();
public Vector<DiTank> getDtk() {
return dtk;
}
public void setDtk(Vector<DiTank> dtk) {
this.dtk = dtk;
}
public static Vector<Weizhi> dupan()
{
try {
fr=new FileReader("e:/TKDZ/cpjl.txt");
br=new BufferedReader(fr);
String s="";
s=br.readLine();//读取一行
sdtj=Integer.parseInt(s);//转成数字
while((s=br.readLine())!=null)
{
String[] sz=s.split(" ");
Weizhi wz=new Weizhi(Integer.parseInt(sz[0]),Integer.parseInt(sz[1]),Integer.parseInt(sz[2]));
wzjh.add(wz);
}
}catch (Exception e){}
finally{
try {
br.close();
fr.close();
}catch (Exception e){}
}
return wzjh;
}
public static void bcjl()
{
try {
fw=new FileWriter("e:/TKDZ/cpjl.txt");
bw=new BufferedWriter(fw);
bw.write(sdtj+"\r\n");
}catch (Exception e){}
finally{
try {
bw.close();
fw.close();
}catch (Exception e){}
}
}
public void cunpan()
{
try {
fw=new FileWriter("e:/TKDZ/cpjl.txt");
bw=new BufferedWriter(fw);
bw.write(sdtj+"\r\n");
for(int i=0;i<dtk.size();i++)
{
DiTank dt=dtk.get(i);
if(dt.shengming)
{
String zb=dt.x+" "+dt.y+" "+dt.fangxiang;
bw.write(zb+"\r\n");
}
}
}catch (Exception e){}
finally{
try {
bw.close();
fw.close();
}catch (Exception e){}
}
}
public static void dqjl()
{
try {
fr=new FileReader("e:/TKDZ/cpjl.txt");
br=new BufferedReader(fr);
String s=br.readLine();
sdtj=Integer.parseInt(s);
} catch (Exception e){}
finally{
try {
br.close();
fr.close();
}catch (Exception e){}
}
}
public static int getSdtj() {
return sdtj;
}
public static void setSdtj(int sdtj) {
Jilu.sdtj = sdtj;
}
public static int getDtsl() {
return dtsl;
}
public static void setDtsl(int dtsl) {
Jilu.dtsl = dtsl;
}
public static int getMtsl() {
return mtsl;
}
public static void setMtsl(int mtsl) {
Jilu.mtsl = mtsl;
}
public static void dtjs()
{
dtsl--;
}
public static void sdsl()
{
sdtj++;
}
}
class Weizhi{
int x;
int y;
int fangxiang;
public Weizhi(int x,int y,int fangxiang)
{
this.x=x;
this.y=y;
this.fangxiang=fangxiang;
}
}
~~~
MyTank.java
~~~
package tkdz;
import java.util.Vector;
//因为子弹都是跟着坦克走的,所以子弹的功能大多数都跟坦克类有关
public class MyTank extends Tank{
Vector<Zidan> aa =new Vector<Zidan>();
Zidan zd=null;
public MyTank(int x, int y) {
super(x, y);
}
public void xiangshang()
{
y-=sudu;
}
public void xiangzuo()
{
x-=sudu;
}
public void xiangxia()
{
y+=sudu;
}
public void xiangyou()
{
x+=sudu;
}
//子弹定义在我的坦克里,因为子弹是随着我的坦克走的
public void fszd(){
switch(this.fangxiang){
case 0:
zd=new Zidan(x+10,y,0);//0控制的子弹方向
aa.add(zd);
break;
case 1:
zd=new Zidan(x,y+10,1);
aa.add(zd);
break;
case 2:
zd=new Zidan(x+10,y+30,2);
aa.add(zd);
break;
case 3:
zd=new Zidan(x+30,y+10,3);
aa.add(zd);
break;
}
Thread t=new Thread(zd);//启动线程,发射子弹
t.start();
}
}
~~~
DiTank.java
~~~
package tkdz;
import java.util.Vector;
public class DiTank extends Tank implements Runnable{
int sudu=2;
int time=0;
Vector<Zidan> dzd=new Vector<Zidan>();
Vector<DiTank> dtk=new Vector<DiTank>();
public DiTank(int x, int y) {
super(x, y);
}
public void dtkxl(Vector<DiTank> dxl)
{
this.dtk=dxl;
}
//互相碰撞
public boolean huxiangpengzhuang()
{
boolean b=false;
switch(this.fangxiang)
{
case 0:
for(int i=0;i<dtk.size();i++)
{
DiTank dt=dtk.get(i);
if(dt!=this)
{
if(dt.fangxiang==0||dt.fangxiang==2)
{
if(this.x>=dt.x && this.x<=dt.x+20 && this.y>=dt.y && this.y<=dt.y+30)
{
return true;
}
if(this.x+20>=dt.x && this.x+20<=dt.x+20 && this.y>=dt.y && this.y<=dt.y+30)
{
return true;
}
}
if(dt.fangxiang==3||dt.fangxiang==1)
{
if(this.x>=dt.x && this.x<=dt.x+30 && this.y>=dt.y && this.y<=dt.y+20)
{
return true;
}
if(this.x+20>=dt.x && this.x+20<=dt.x+30 && this.y>=dt.y && this.y<=dt.y+20)
{
return true;
}
}
}
}
break;
case 1:
for(int i=0;i<dtk.size();i++)
{
DiTank dt=dtk.get(i);
if(dt!=this)
{
if(dt.fangxiang==0||dt.fangxiang==2)
{
if(this.x>=dt.x&&this.x<=dt.x+20&&this.y>=dt.y&&this.y<=dt.y+30)
{
return true;
}
//下一点
if(this.x>=dt.x&&this.x<=dt.x+20&&this.y+20>=dt.y&&this.y+20<=dt.y+30)
{
return true;
}
}
if(dt.fangxiang==3||dt.fangxiang==1)
{
if(this.x>=dt.x&&this.x<=dt.x+30&&this.y>=dt.y&&this.y<=dt.y+20)
{
return true;
}
if(this.x>=dt.x&&this.x<=dt.x+30&&this.y+20>=dt.y&&this.y+20<=dt.y+20)
{
return true;
}
}
}
}
break;
case 2:
for(int i=0;i<dtk.size();i++)
{
DiTank dt=dtk.get(i);
if(dt!=this)
{
if(dt.fangxiang==0||dt.fangxiang==2)
{
if(this.x>=dt.x&&this.x<=dt.x+20&&this.y+30>=dt.y&&this.y+30<=dt.y+30)
{
return true;
}
if(this.x+20>=dt.x&&this.x+20<=dt.x+20&&this.y+30>=dt.y&&this.y+30<=dt.y+30)
{
return true;
}
}
if(dt.fangxiang==3||dt.fangxiang==1)
{
if(this.x>=dt.x&&this.x<=dt.x+30&&this.y+30>=dt.y&&this.y+30<=dt.y+20)
{
return true;
}
if(this.x+20>=dt.x&&this.x+20<=dt.x+30&&this.y+30>=dt.y&&this.y+30<=dt.y+20)
{
return true;
}
}
}
}
break;
case 3:
for(int i=0;i<dtk.size();i++)
{
DiTank dt=dtk.get(i);
if(dt!=this)
{
if(dt.fangxiang==0||dt.fangxiang==2)
{
if(this.x+30>=dt.x && this.x+30<=dt.x+20 && this.y>=dt.y && this.y<=dt.y+30)
{
return true;
}
//下点
if(this.x+30>=dt.x && this.x+30<=dt.x+20 && this.y+20>=dt.y && this.y+20<=dt.y+30)
{
return true;
}
}
if(dt.fangxiang==3||dt.fangxiang==1)
{
if(this.x+30>=dt.x && this.x+30<=dt.x+30 && this.y>=dt.y && this.y<=dt.y+20)
{
return true;
}
if(this.x+30>=dt.x && this.x+30<=dt.x+30 && this.y+20>=dt.y && this.y+20<=dt.y+20)
{
return true;
}
}
}
}
break;
}
return b;//因为上面所有的return都在循环里面,所以编译器会认为不一定有return被执行
}
@Override
public void run() {
while(true){
try {
Thread.sleep(50);
} catch (Exception e) {
}
switch(this.fangxiang){
case 0:
for(int i=0;i<30;i++){
if(y>0&&!huxiangpengzhuang()){y-=sudu;}//防止坦克超出边界
try {
Thread.sleep(50);
} catch (Exception e) {}
}
break;
case 1:
for(int i=0;i<30;i++){
if(x>0&&!huxiangpengzhuang()){x-=sudu;}
try {
Thread.sleep(50);
} catch (Exception e) {}
}
break;
case 2:
for(int i=0;i<30;i++){
if(y<250&&!huxiangpengzhuang()){y+=sudu;}
try {
Thread.sleep(50);
} catch (Exception e) {}
}
break;
case 3:
for(int i=0;i<30;i++){
if(x<360&&!huxiangpengzhuang()){x+=sudu;}
try {
Thread.sleep(50);
} catch (Exception e) {}
}
break;
}
//随机出现0-3之间的数字,0,1,2,3
this.fangxiang=(int)(Math.random()*4);
if(this.shengming==false){
break;
}
this.time++;
if(time%2==0){//子弹速度慢了
if(shengming){
if(dzd.size()<5){
Zidan zd=null;
switch(fangxiang){
case 0:
zd=new Zidan(x+10,y,0);
dzd.add(zd);
break;
case 1:
zd=new Zidan(x,y+10,1);
dzd.add(zd);
break;
case 2:
zd=new Zidan(x+10,y+30,2);
dzd.add(zd);
break;
case 3:
zd=new Zidan(x+30,y+10,3);
dzd.add(zd);
break;
}
Thread t5=new Thread(zd);
t5.start();
}
}
}
}
}
}
~~~
Zidan.java
~~~
package tkdz;
//由于敌人的子弹是随意动的,直接把子弹做成线程,继承Runnable接口
public class Zidan implements Runnable{
int x;
int y;
int fangxiang;
int sudu=5;
boolean shengming=true;//生命
public Zidan(int x, int y,int fangxiang) {
super();
this.x = x;
this.y = y;
this.fangxiang=fangxiang;
}
@Override
public void run() {//让子弹动起来
//凡是线程下面的死循环里都要有个睡眠
while(true){
try{
Thread.sleep(50);//睡眠
}catch(Exception e){}
switch(this.fangxiang){
case 0:
y-=sudu;
break;
case 1:
x-=sudu;
break;
case 2:
y+=sudu;
break;
case 3:
x+=sudu;
break;
}
if(x<0||x>400||y<0||y>300){//让子弹超出画布就消失
this.shengming=false;
break;
}
}
}
}
~~~
MyPanel.java
~~~
package tkdz;
import java.awt.*;
import java.awt.event.*;
import java.util.Vector;
import javax.swing.*;
class GuankaPanel extends JPanel implements Runnable
{
int times=0;
public void paint(Graphics g)
{
super.paint(g);
g.fillRect(0, 0, 400, 300);
if(times%2==0)
{
g.setColor(Color.yellow);
Font myFont=new Font("华文行楷",Font.BOLD,38);
g.setFont(myFont);
g.drawString("第1关", 140, 140);
}
}
public void run()
{
while(true)
{
try
{
Thread.sleep(600);
}
catch (Exception e){}
times++;
this.repaint();
}
}
}
public class MyPanel extends JPanel implements KeyListener,Runnable{
MyTank mt=null;
Vector<DiTank> dtk =new Vector<DiTank>();//敌坦克集合,多线程用Vector
Vector<Baozha> bzjh=new Vector<Baozha>();//爆炸集合
int tksl =3;//敌人坦克的数量
//爆炸图片初始化
Image tp1=null;
Image tp2=null;
Image tp3=null;
public MyPanel(String ss){
Jilu.dqjl();//放在构造函数里,每次new MyPanel都会去读取一次
mt=new MyTank(140,232);//我的坦克,1辆
if(ss.equals("newGame")){//新游戏
for(int i=0;i<tksl;i++){//敌坦克数量,3辆
DiTank dt=new DiTank((i)*181+5,0);
dt.setFangxiang(2);//设置敌坦初始方向为下
dt.dtkxl(dtk);
Thread t =new Thread(dt);//启动线程
t.start();
Zidan zd=new Zidan(dt.x+10,dt.y+30,2);
dt.dzd.add(zd);
Thread t3 =new Thread(zd);//启动线程
t3.start();
dtk.add(dt);
}
}
tp1=Toolkit.getDefaultToolkit().getImage(Panel.class.getResource("/bzxg1.gif"));
tp2=Toolkit.getDefaultToolkit().getImage(Panel.class.getResource("/bzxg2.gif"));
tp3=Toolkit.getDefaultToolkit().getImage(Panel.class.getResource("/bzxg3.gif"));
}
public void tjsj(Graphics g)//统计数据
{
this.drawTank(80,330, g, 0, 0);
g.setColor(Color.black);
g.drawString(Jilu.getMtsl()+"",116,350);//我的坦克数量
this.drawTank(150, 330, g, 0, 1);
g.setColor(Color.black);
g.drawString(Jilu.getDtsl()+"",186,350);//敌方坦克数量
this.drawTank(450, 86, g, 0,1);
g.setColor(Color.black);
g.drawString(Jilu.getSdtj()+"",486,107);//杀敌统计
g.setColor(Color.black);
Font f=new Font("华文彩云",Font.BOLD,20);
g.setFont(f);
g.drawString("您消灭的坦克总数", 410, 40);
}
public void paint(Graphics g){
super.paint(g);
g.fillRect(0, 0, 400, 300);//黑色400*300画布
this.tjsj(g);//绘制统计数据
if(mt.shengming){
this.drawTank(mt.getX(), mt.getY(), g, mt.fangxiang, 0);//绘制我方坦克
}
for(int i = 0; i < dtk.size(); i++){//绘制敌方坦克
//this.drawTank(dtk.get(i).getX(), dtk.get(i).getY(), g, 2, 1);
DiTank dt=dtk.get(i);
if(dt.shengming){
this.drawTank(dt.getX(), dt.getY(), g, dt.fangxiang, 1);
for(int j=0;j<dt.dzd.size();j++)//绘制敌方子弹
{
Zidan dtzd=dt.dzd.get(j);
if(dtzd.shengming)
{
g.setColor(Color.white);
g.fill3DRect(dtzd.x,dtzd.y,3,3,false);
}else{
dt.dzd.remove(dtzd);
}
}
}
}
for(int i=0;i<mt.aa.size();i++){
Zidan zd=mt.aa.get(i);
if(zd!=null&& zd.shengming==true){//绘制子弹
g.setColor(Color.white);
g.fill3DRect(zd.x, zd.y, 3, 3, false);
}
if(zd.shengming==false){
mt.aa.remove(zd);
}
}
for(int i=0;i<bzjh.size();i++){
Baozha bz=bzjh.get(i);
if(bz.shengcunqi>600){
g.drawImage(tp1, bz.x, bz.y, 30, 30, this);
}else if(bz.shengcunqi>300){
g.drawImage(tp2, bz.x, bz.y, 30, 30, this);
}else{
g.drawImage(tp3, bz.x, bz.y, 30, 30, this);
}
bz.suqsd();
if(bz.shengcunqi==0){
bzjh.remove(bz);
}
}
}
//击中我方
public void jzwf()
{
for(int i=0;i<this.dtk.size();i++)
{
DiTank dt=dtk.get(i);
for(int j=0;j<dt.dzd.size();j++)
{
Zidan zd=dt.dzd.get(j);
/*if(mt.shengming)
{*/
this.jzdf(zd,mt);
/*} */
}
}
}
public void jzdf1()
{
for(int i=0;i<mt.aa.size();i++)
{
Zidan zd=mt.aa.get(i);
if(zd.shengming)
{
for(int j=0;j<dtk.size();j++)
{
DiTank dt=dtk.get(j);
if(dt.shengming)
{
if(dt.shengming)
{
if(this.jzdf(zd,dt))
{
Jilu.dtjs();
Jilu.sdsl();
}
}
}
}
}
this.repaint();
}
}
//击中敌方
public boolean jzdf(Zidan zd,Tank dt){
boolean b2=false;
switch(dt.fangxiang){
case 0://上下很像,一起判断
case 2:
if(zd.x>dt.x&&zd.x<dt.x+20&&zd.y>dt.y&&zd.y<dt.y+30){
zd.shengming=false;
dt.shengming=false;
b2=true;
Baozha bz=new Baozha(dt.x,dt.y);
bzjh.add(bz);
}
break;
case 1:
case 3:
if(zd.x>dt.x&&zd.x<dt.x+30&&zd.y>dt.y&&zd.y<dt.y+20){
zd.shengming=false;
dt.shengming=false;
b2=true;
Baozha bz=new Baozha(dt.x,dt.y);
bzjh.add(bz);
}
}
return b2;
}
public void drawTank(int x,int y,Graphics g,int fangxiang,int leixing)
{
switch(leixing)
{
case 0://我的坦克
g.setColor(Color.yellow);
break;
case 1://敌人的坦克
g.setColor(Color.green);
break;
}
switch(fangxiang)
{
case 0://上
g.fill3DRect(x, y, 5, 30,false);
g.fill3DRect(x+15,y , 5, 30,false);
g.fill3DRect(x+5,y+5 , 10, 20,false);
g.fillOval(x+5, y+10, 10, 10);
g.drawLine(x+10, y+15, x+10, y-3);
break;
case 1://左
g.fill3DRect(x, y, 30, 5,false);
g.fill3DRect(x, y+15, 30, 5, false);
g.fill3DRect(x+5, y+5, 20, 10, false);
g.fillOval(x+10, y+5, 10, 10);
g.drawLine(x+15, y+10, x-3, y+10);
break;
case 2://下
g.fill3DRect(x, y, 5, 30,false);
g.fill3DRect(x+15,y , 5, 30,false);
g.fill3DRect(x+5,y+5 , 10, 20,false);
g.fillOval(x+5, y+10, 10, 10);
g.drawLine(x+10, y+15, x+10, y+33);
break;
case 3://右
g.fill3DRect(x, y, 30, 5,false);
g.fill3DRect(x, y+15, 30, 5, false);
g.fill3DRect(x+5, y+5, 20, 10, false);
g.fillOval(x+10, y+5, 10, 10);
g.drawLine(x+15, y+10, x+33, y+10);
break;
}
this.repaint();
}
@Override
public void keyTyped(KeyEvent e) {
// TODO Auto-generated method stub
}
@Override
public void keyPressed(KeyEvent e) {
if(e.getKeyCode()==KeyEvent.VK_W)
{
this.mt.setFangxiang(0);//方向为0
this.mt.xiangshang();//启动函数向上
}else if(e.getKeyCode()==KeyEvent.VK_A)
{
this.mt.setFangxiang(1);
this.mt.xiangzuo();
}else if(e.getKeyCode()==KeyEvent.VK_S)
{
this.mt.setFangxiang(2);
this.mt.xiangxia();
}else if(e.getKeyCode()==KeyEvent.VK_D)
{
this.mt.setFangxiang(3);
this.mt.xiangyou();
}
//子弹
if(e.getKeyCode()==KeyEvent.VK_J){
if(mt.shengming){
if(this.mt.aa.size()<8){
this.mt.fszd();//发射子弹
}
}
}
this.repaint();
}
@Override
public void keyReleased(KeyEvent e) {
// TODO Auto-generated method stub
}
@Override
public void run() {
while(true){
try {
Thread.sleep(100);
} catch (Exception e) {
//this.repaint();
}
//这里用二层循环的目的是,让每发子弹去和每个敌人坦克比较
/*for(int i=0;i<mt.aa.size();i++){
Zidan zd=mt.aa.get(i);
if(zd.shengming){
for(int j=0;j<dtk.size();j++){
DiTank dt=dtk.get(j);
if(dt.shengming){
this.jzdf(zd,dt);//击中敌方
}
}
}
this.repaint();
}*/
this.jzdf1();
this.jzwf();
this.repaint();
//this.repaint();
}
}
}
~~~
![](https://box.kancloud.cn/22eaea5f8abf5c8eb41e5022e1137d53_600x495.png)
- 书写心得
- 基础回顾
- 异常的处理
- equils方法
- 集合类
- ArrayList的遍历和添加
- ArrayList的删除插入
- 实例:食品库存管理
- HashMap
- 集合类的区别和选择
- 泛型和反射机制
- 图形化用户界面(GUI)
- JFrame容器
- 边界布局管理器
- 流式布局管理器
- 网格布局管理器
- Jpanel面板
- 文本框和标签
- 单选按钮和复选按钮
- 下拉列表框和滚动条
- 拆分窗口
- 聊天窗口
- 用户登录界面
- 记事本界面
- 线程
- 创建线程的方法
- 线程的优先级
- 线程的睡眠
- 线程的让步与阻塞
- 买票问题
- 生产消费问题
- IO流
- 字符流
- 字节流
- 缓冲流
- 数据流传输
- 转换流
- 空字符串区别
- Print流
- Object
- IO流补充
- 绘图技术和事件处理机制
- 绘图基础-绘制图形
- 绘图基础-绘制图像
- 绘图基础-绘制文字
- 事件处理-事件监听
- 事件处理-控件事件
- 事件处理-键盘事件
- 事件处理-鼠标事件
- 事件处理-窗口事件
- 记事本
- 坦克大战
- 阶段1
- 阶段2
- 阶段3
- 阶段4
- 阶段5
- 阶段6
- 阶段7
- 阶段8
- 阶段9
- 阶段10
- 阶段11
- 阶段12
- 阶段13
- 阶段14
- SQL Server 2005
- 简易学生管理系统
- 阶段(1)-显示
- 阶段(2)-查询
- 阶段(3)-添加
- 阶段(4)-删除
- 阶段(5)-修改
- 简易餐饮管理系统
- 阶段-01
- 阶段-02
- 阶段-03
- 阶段-04
- Index.java
- Login.java
- Main.java
- MyFont.java
- ImagePanel.java
- Conn.java
- Moxing.java
- 网络编程基础
- 互发信息(1)-传输
- 互发信息(2)-互发
- 互发信息(3)-GUI
- 互发信息(4)-对象流
- 网络聊天工具
- 阶段--01--界面
- Server
- Index
- Client
- Login
- Chat
- List