java applet 小程序,为什么运行的时候提说未初始化小程序呢,还有提示空指针?求高手解答!抱歉没分了跪
/****@longlongadministrator*CustomerFeedback**/importjava.awt.*;importjava.applet.*;/...
/**
*
* @longlong administrator
* Customer Feedback
*
*/
import java.awt.*;
import java.applet.*;
/*<applet code = "./BankApplet.java" width="600" height="500"></applet>*/
public class BankApplet extends Applet{
Label lbankName, blabel, lname, lemailadd, lsubject,lmessage;
TextField tfname, tfemailid, tfsubject;
Button submit, reset;
TextArea tamessage;
public void init(){
/*Creating Instances of the Label class*/
lbankName = new Label(" MoneySaver Corporation");
blabel = new Label(" ");
lemailadd = new Label(" E-mail Address");
lsubject = new Label("Subject");
lmessage = new Label("Message");
tfname = new TextField(10);
tfemailid = new TextField(10);
tfsubject = new TextField("Feedback", 10);
submit = new Button("Submit");
reset = new Button("Reset");
tamessage = new TextArea("type your text here");
Font f = new Font("Arial",Font.BOLD | Font.ITALIC,25);
Font f1 = new Font("Arial", Font.BOLD | Font.ITALIC,15);
lbankName.setFont(f);
lname.setFont(f1);
lemailadd.setFont(f1);
lsubject.setFont(f1);
lmessage.setFont(f1);
setLayout(new GridLayout(6,2,8,8));
add(lbankName);
add(blabel);
add(lname);
add(tfname);
add(lemailadd);
add(tfemailid);
add(lsubject);
add(tfsubject);
add(lmessage);
add(tamessage);
add(submit);
add(reset);
}
// public static void main(String[] args) {
// BankApplet bankt = new BankApplet();
// bankt.init();
// }
} 展开
*
* @longlong administrator
* Customer Feedback
*
*/
import java.awt.*;
import java.applet.*;
/*<applet code = "./BankApplet.java" width="600" height="500"></applet>*/
public class BankApplet extends Applet{
Label lbankName, blabel, lname, lemailadd, lsubject,lmessage;
TextField tfname, tfemailid, tfsubject;
Button submit, reset;
TextArea tamessage;
public void init(){
/*Creating Instances of the Label class*/
lbankName = new Label(" MoneySaver Corporation");
blabel = new Label(" ");
lemailadd = new Label(" E-mail Address");
lsubject = new Label("Subject");
lmessage = new Label("Message");
tfname = new TextField(10);
tfemailid = new TextField(10);
tfsubject = new TextField("Feedback", 10);
submit = new Button("Submit");
reset = new Button("Reset");
tamessage = new TextArea("type your text here");
Font f = new Font("Arial",Font.BOLD | Font.ITALIC,25);
Font f1 = new Font("Arial", Font.BOLD | Font.ITALIC,15);
lbankName.setFont(f);
lname.setFont(f1);
lemailadd.setFont(f1);
lsubject.setFont(f1);
lmessage.setFont(f1);
setLayout(new GridLayout(6,2,8,8));
add(lbankName);
add(blabel);
add(lname);
add(tfname);
add(lemailadd);
add(tfemailid);
add(lsubject);
add(tfsubject);
add(lmessage);
add(tamessage);
add(submit);
add(reset);
}
// public static void main(String[] args) {
// BankApplet bankt = new BankApplet();
// bankt.init();
// }
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询