我试了一下这个包倒入有问题.
不知道你运行时出现没有..
import com.borland.jbcl.layout.*;
将包改成这样就可以了..
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import com.borland.jbcl.layout.*;
//import com.sun.java.swing.UIManager;
public class Untitled1 extends Applet {
boolean isStandalone = false;
GridBagLayout gridBagLayout1 = new GridBagLayout();
GridBagConstraints con=new GridBagConstraints();
XYLayout xYLayout1 = new XYLayout();
TextField textField1 = new TextField();
Label label1 = new Label();
XYLayout xYLayout2 = new XYLayout();
public Untitled1() {
} public void init() {
try {
jbInit();
}
catch (Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
textField1.setText("textField1");
label1.setText("label1");
this.setLayout(xYLayout2);
con.weightx=1;
con.weighty=2;
this.add(label1, new XYConstraints(0, 0, 0, 0));
this.add(textField1, new XYConstraints(28, 18, -1, -1));
} public String getAppletInfo() {
return "Applet Information";
}
public String[][] getParameterInfo() {
return null;
}
}
HTML
<html>
<head>
</head>
<body>
<applet code="Untitled1.class" height=300 width=300>
</applet>
</body>
</html>
不知道你运行时出现没有..
import com.borland.jbcl.layout.*;
将包改成这样就可以了..
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import com.borland.jbcl.layout.*;
//import com.sun.java.swing.UIManager;
public class Untitled1 extends Applet {
boolean isStandalone = false;
GridBagLayout gridBagLayout1 = new GridBagLayout();
GridBagConstraints con=new GridBagConstraints();
XYLayout xYLayout1 = new XYLayout();
TextField textField1 = new TextField();
Label label1 = new Label();
XYLayout xYLayout2 = new XYLayout();
public Untitled1() {
} public void init() {
try {
jbInit();
}
catch (Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
textField1.setText("textField1");
label1.setText("label1");
this.setLayout(xYLayout2);
con.weightx=1;
con.weighty=2;
this.add(label1, new XYConstraints(0, 0, 0, 0));
this.add(textField1, new XYConstraints(28, 18, -1, -1));
} public String getAppletInfo() {
return "Applet Information";
}
public String[][] getParameterInfo() {
return null;
}
}
HTML
<html>
<head>
</head>
<body>
<applet code="Untitled1.class" height=300 width=300>
</applet>
</body>
</html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货