代码如下:
import java.applet.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;public class AppletMessage extends Applet implements ActionListener
{
TextField textXin=new TextField(30);
TextField textMing=new TextField(30);
TextField textStreet=new TextField(30);
TextField textContry=new TextField(30);
TextField textZhou=new TextField(30);
TextField textYoubian=new TextField(30);
TextArea showAll=new TextArea(10 ,30);
JButton buttonAdd=new JButton("组合");
String strXin;
String strMing;
String strStreet;
String strContry;
String strZhou;
String strYoubian;
//String strAll;
public void init(){
add(textXin);
add(textMing);
add(textStreet);
add(textContry);
add(textZhou);
add(textYoubian);
add(buttonAdd);
buttonAdd.addActionListener(this);
}
public void actionPerformed(ActionEvent event){
String all;
strXin=textXin.getText();
strMing=textMing.getText();
strStreet=textStreet.getText();
strContry=textContry.getText();
strZhou=textZhou.getText();
strYoubian=textYoubian.getText();
all=strXin+" "+strMing+" "+strStreet+" "+strContry+" "+strContry+" "+strZhou+" "+strYoubian;
showAll.append(all); textXin.setText("");
textMing.setText(""); textXin.requestFocus();
} }
import java.applet.*;
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;public class AppletMessage extends Applet implements ActionListener
{
TextField textXin=new TextField(30);
TextField textMing=new TextField(30);
TextField textStreet=new TextField(30);
TextField textContry=new TextField(30);
TextField textZhou=new TextField(30);
TextField textYoubian=new TextField(30);
TextArea showAll=new TextArea(10 ,30);
JButton buttonAdd=new JButton("组合");
String strXin;
String strMing;
String strStreet;
String strContry;
String strZhou;
String strYoubian;
//String strAll;
public void init(){
add(textXin);
add(textMing);
add(textStreet);
add(textContry);
add(textZhou);
add(textYoubian);
add(buttonAdd);
buttonAdd.addActionListener(this);
}
public void actionPerformed(ActionEvent event){
String all;
strXin=textXin.getText();
strMing=textMing.getText();
strStreet=textStreet.getText();
strContry=textContry.getText();
strZhou=textZhou.getText();
strYoubian=textYoubian.getText();
all=strXin+" "+strMing+" "+strStreet+" "+strContry+" "+strContry+" "+strZhou+" "+strYoubian;
showAll.append(all); textXin.setText("");
textMing.setText(""); textXin.requestFocus();
} }
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货