Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

wux bill

Greenhorn
+ Follow
since Nov 10, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by wux bill

First thank you for your coming ;
Yesterday I had download JDk1.4.2_03 and tomact5016
I Had leanrd java before ,but not jsp
I don't konwn how to set classpath for tomact ,would you tell me?
thank you again;
16 years ago
first thank you for your coming;
I am a frshman in java;
I have learned java for about one year.
now I am leaning << Distributed Programing with java>> ( The author is Qusay H.Mahmoud >>
My problem is should I need two computer to learn that?
this nignt I run a serverSocket program and a ClientSocket program
It thows NullPointerException;
16 years ago
The problem:
As I pressed the Button ,but the JLabel doesn't display;
the program is follow:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.Random;

public class Toocaiquan implements ActionListener{
Frame fr=new Frame();
Toocaiquan(){
init();}
JButton bt1=new JButton("石头");
JButton bt2=new JButton("剪刀");
JButton bt3=new JButton("布");
Panel p=new Panel();
//Te/xtArea te=new TextArea(200,200);
public void actionPerformed(ActionEvent e)
{
Random ra=new Random();
int c=ra.nextInt(2);

if(e.getSource()==bt1)

switch(c){
case 0:
p.add(new JLabel("你赢了"));
break;
case 1:
p.add(new JLabel("平了"));
break;
case 2:
p.add(new JLabel("你输了"));
break;
}
else if (e.getSource()==bt2)

switch(c){
case 0:
p.add(new JLabel("平了"));
break;
case 1:
p.add(new JLabel("你输了"));
break;
case 2:
p.add(new JLabel("你赢了"));

break;
}
else if (e.getSource()==bt3)

switch(c){
case 0:
p.add(new JLabel("你输了"));
break;
case 1:
p.add(new JLabel("你赢了"));
break;
case 2:
p.add(new JLabel("你输了"));
break;

}
}

public void init(){

//super("猜拳");
bt1.addActionListener(this);
bt2.addActionListener(this);
bt3.addActionListener(this);

p.add(bt1);
p.add(bt2);
p.add(bt3);
fr.add(p);
//fr.add(te);

fr.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}
});
fr.setSize(600,500);
fr.setVisible(true);

}
//addWindowListener(new win());



public static void main (String args[]){

new Toocaiquan();

}



}
16 years ago
to be frank,my name is lee yang.I has registered my name.But when I logined some days later,the system tips my password was wrong.But I make sure that my password wasn't wrong.there is a method by email to find password,what a pity,when I was registering I wasn't input my email.So,I get this name wux bill.
that's all.
thanks.
16 years ago
what's mean of Is your name really "void void"?,but his name is Pat Stary.
16 years ago