有高手吗,帮我解决一下这个问题好吗

wangcn 2004-04-09 07:07:49
package untitled1;

import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import borland.jbcl.layout.*;

//import com.sun.java.swing.UIManager;
public class Applet1 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();


public Applet1() {
}

public void init() {
try {
jbInit();
}
catch (Exception e) {
e.printStackTrace();
}
}


private void jbInit() throws Exception {
textField1.setText("textField1");
label1.setText("label1");
this.setLayout(xYLayout1);
con.weightx=1;
con.weighty=2;
this.add(textField1, new XYConstraints(193, 56, -1, -1));
this.add(label1, new XYConstraints(55, 56, -1, -1));


}

public String getAppletInfo() {
return "Applet Information";
}
public String[][] getParameterInfo() {
return null;
}
}

帮我运行一下,为什么在浏览器中无法运行啊,解决这个问题好没
...全文
15 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
DESL 2004-04-10
  • 打赏
  • 举报
回复
昨天就帮你做了你没有看吗?
DESL 2004-04-10
  • 打赏
  • 举报
回复
Untitled1.java文件

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>
测试通过!!!如果需要我可以把工程发给你!!!
CoolAbu 2004-04-09
  • 打赏
  • 举报
回复
你不是已经发过一次这样的帖子了么?

import borland.jbcl.layout.*;
换成
import com.borland.jbcl.layout.*;//你这个包中少写了一个com,

我试了上个Applet,试好着的,除了这个com少写了以外。
leeak 2004-04-09
  • 打赏
  • 举报
回复
最好贴出 出错在哪了 大家好帮你

67,515

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧