jbuilder写applet,用了xylayout,dataset等,怎样发布呢 直接将html文件在ie中打开,如果applet显示不对是路径得问题 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在applet中不一定能访问数据库,没试过。最好不再applet中do this 把jb\lib\jbcl.jar放到你的classpath中就可以了!告诉你一个最好的方法!!!其实他就用到了两个类文件代替你的com.borland.jbcl.*就哦ok!!!1XYConstraints.javaimport java.io.Serializable;public class XYConstraints implements Cloneable, Serializable{ int x; int y; int width; int height; public XYConstraints() { this(0, 0, 0, 0); } public XYConstraints(int x, int y, int width, int height) { this.x = x; this.y = y; this.width = width; this.height = height; } public int getX() { return x; } public void setX(int x) { this.x = x; } public int getY() { return y; } public void setY(int y) { this.y = y; } public int getWidth() { return width; } public void setWidth(int width) { this.width = width; } public int getHeight() { return height; } public void setHeight(int height) { this.height = height; } public int hashCode() { return x ^ y * 37 ^ width * 43 ^ height * 47; } public boolean equals(Object that) { if(that instanceof XYConstraints) { XYConstraints other = (XYConstraints)that; return other.x == x && other.y == y && other.width == width && other.height == height; } else { return false; } } public Object clone() { return new XYConstraints(x, y, width, height); } public String toString() { return String.valueOf(String.valueOf((new StringBuffer("XYConstraints[")).append(x).append(",").append(y).append(",").append(width).append(",").append(height).append("]"))); }}/// XYLayout.javaimport java.awt.*;import java.io.Serializable;import java.util.Hashtable;// Referenced classes of package com.borland.jbcl.layout:// XYConstraintspublic class XYLayout implements LayoutManager2, Serializable{ private static final long serialVersionUID = 200L; int width; int height; Hashtable info; static final XYConstraints defaultConstraints = new XYConstraints(); public XYLayout() { info = new Hashtable(); } public XYLayout(int width, int height) { info = new Hashtable(); this.width = width; this.height = height; } public int getWidth() { return width; } public void setWidth(int width) { this.width = width; } public int getHeight() { return height; } public void setHeight(int height) { this.height = height; } public String toString() { return String.valueOf(String.valueOf((new StringBuffer("XYLayout[width=")).append(width).append(",height=").append(height).append("]"))); } public void addLayoutComponent(String s, Component component1) { } public void removeLayoutComponent(Component component) { info.remove(component); } public Dimension preferredLayoutSize(Container target) { return getLayoutSize(target, true); } public Dimension minimumLayoutSize(Container target) { return getLayoutSize(target, false); } public void layoutContainer(Container target) { Insets insets = target.getInsets(); int count = target.getComponentCount(); for(int i = 0; i < count; i++) { Component component = target.getComponent(i); if(component.isVisible()) { Rectangle r = getComponentBounds(component, true); component.setBounds(insets.left + r.x, insets.top + r.y, r.width, r.height); } } } public void addLayoutComponent(Component component, Object constraints) { if(constraints instanceof XYConstraints) { info.put(component, constraints); } } public Dimension maximumLayoutSize(Container target) { return new Dimension(0x7fffffff, 0x7fffffff); } public float getLayoutAlignmentX(Container target) { return 0.5F; } public float getLayoutAlignmentY(Container target) { return 0.5F; } public void invalidateLayout(Container container) { } Rectangle getComponentBounds(Component component, boolean doPreferred) { XYConstraints constraints = (XYConstraints)info.get(component); if(constraints == null) { constraints = defaultConstraints; } Rectangle r = new Rectangle(constraints.x, constraints.y, constraints.width, constraints.height); if(r.width <= 0 || r.height <= 0) { Dimension d = doPreferred ? component.getPreferredSize() : component.getMinimumSize(); if(r.width <= 0) { r.width = d.width; } if(r.height <= 0) { r.height = d.height; } } return r; } Dimension getLayoutSize(Container target, boolean doPreferred) { Dimension dim = new Dimension(0, 0); if(width <= 0 || height <= 0) { int count = target.getComponentCount(); for(int i = 0; i < count; i++) { Component component = target.getComponent(i); if(component.isVisible()) { Rectangle r = getComponentBounds(component, doPreferred); dim.width = Math.max(dim.width, r.x + r.width); dim.height = Math.max(dim.height, r.y + r.height); } } } if(width > 0) { dim.width = width; } if(height > 0) { dim.height = height; } Insets insets = target.getInsets(); dim.width += insets.left + insets.right; dim.height += insets.top + insets.bottom; return dim; }/* static { serialVersionUID = 200L; }*/} import com.borland.dx.sql.dataset.*;还有个这个怎么办?如何给别人也能运行,没人改classpath太麻烦了每个客户端还要有jbcl.jar怎么办?!?! 直接选择打包工具,将需要的文件jar到一起,然后再html里面德applet中加一个参数加上archive="xxx.jar"就行了 关于java常量池和data segment的问题! java 文本显示 C# 里Form对象 form = null 和 form.dispose的区别 a[0]="中国人)"; 怎么把")" 去掉. 有关两个main()方法的问题?? 鼠标模拟事件?? 班竹:为什么我一天掉了11的信誉值?我是怎么了?扣分也发给短信告诉我是为什么?2次这样对我拉! 征集大型系统方案!!!! 关于路径设置的问题,问了三遍怎么就没人回答呢??? 如何在Windows98下安装配置Ant? 请教各位一个有关DataStream中的一些问题!!! java 能否有 MDI窗体.
最好不再applet中do this
告诉你一个最好的方法!!!其实他就用到了两个类文件
代替你的com.borland.jbcl.*
就哦ok!!!1
XYConstraints.javaimport java.io.Serializable;public class XYConstraints
implements Cloneable, Serializable
{ int x;
int y;
int width;
int height; public XYConstraints()
{
this(0, 0, 0, 0);
} public XYConstraints(int x, int y, int width, int height)
{
this.x = x;
this.y = y;
this.width = width;
this.height = height;
} public int getX()
{
return x;
} public void setX(int x)
{
this.x = x;
} public int getY()
{
return y;
} public void setY(int y)
{
this.y = y;
} public int getWidth()
{
return width;
} public void setWidth(int width)
{
this.width = width;
} public int getHeight()
{
return height;
} public void setHeight(int height)
{
this.height = height;
} public int hashCode()
{
return x ^ y * 37 ^ width * 43 ^ height * 47;
} public boolean equals(Object that)
{
if(that instanceof XYConstraints)
{
XYConstraints other = (XYConstraints)that;
return other.x == x && other.y == y && other.width == width && other.height == height;
} else
{
return false;
}
} public Object clone()
{
return new XYConstraints(x, y, width, height);
} public String toString()
{
return String.valueOf(String.valueOf((new StringBuffer("XYConstraints[")).append(x).append(",").append(y).append(",").append(width).append(",").append(height).append("]")));
}
}
///
XYLayout.javaimport java.awt.*;
import java.io.Serializable;
import java.util.Hashtable;// Referenced classes of package com.borland.jbcl.layout:
// XYConstraintspublic class XYLayout
implements LayoutManager2, Serializable
{ private static final long serialVersionUID = 200L;
int width;
int height;
Hashtable info;
static final XYConstraints defaultConstraints = new XYConstraints(); public XYLayout()
{
info = new Hashtable();
} public XYLayout(int width, int height)
{
info = new Hashtable();
this.width = width;
this.height = height;
} public int getWidth()
{
return width;
} public void setWidth(int width)
{
this.width = width;
} public int getHeight()
{
return height;
} public void setHeight(int height)
{
this.height = height;
} public String toString()
{
return String.valueOf(String.valueOf((new StringBuffer("XYLayout[width=")).append(width).append(",height=").append(height).append("]")));
} public void addLayoutComponent(String s, Component component1)
{
} public void removeLayoutComponent(Component component)
{
info.remove(component);
} public Dimension preferredLayoutSize(Container target)
{
return getLayoutSize(target, true);
} public Dimension minimumLayoutSize(Container target)
{
return getLayoutSize(target, false);
} public void layoutContainer(Container target)
{
Insets insets = target.getInsets();
int count = target.getComponentCount();
for(int i = 0; i < count; i++)
{
Component component = target.getComponent(i);
if(component.isVisible())
{
Rectangle r = getComponentBounds(component, true);
component.setBounds(insets.left + r.x, insets.top + r.y, r.width, r.height);
}
} } public void addLayoutComponent(Component component, Object constraints)
{
if(constraints instanceof XYConstraints)
{
info.put(component, constraints);
}
} public Dimension maximumLayoutSize(Container target)
{
return new Dimension(0x7fffffff, 0x7fffffff);
} public float getLayoutAlignmentX(Container target)
{
return 0.5F;
} public float getLayoutAlignmentY(Container target)
{
return 0.5F;
} public void invalidateLayout(Container container)
{
} Rectangle getComponentBounds(Component component, boolean doPreferred)
{
XYConstraints constraints = (XYConstraints)info.get(component);
if(constraints == null)
{
constraints = defaultConstraints;
}
Rectangle r = new Rectangle(constraints.x, constraints.y, constraints.width, constraints.height);
if(r.width <= 0 || r.height <= 0)
{
Dimension d = doPreferred ? component.getPreferredSize() : component.getMinimumSize();
if(r.width <= 0)
{
r.width = d.width;
}
if(r.height <= 0)
{
r.height = d.height;
}
}
return r;
} Dimension getLayoutSize(Container target, boolean doPreferred)
{
Dimension dim = new Dimension(0, 0);
if(width <= 0 || height <= 0)
{
int count = target.getComponentCount();
for(int i = 0; i < count; i++)
{
Component component = target.getComponent(i);
if(component.isVisible())
{
Rectangle r = getComponentBounds(component, doPreferred);
dim.width = Math.max(dim.width, r.x + r.width);
dim.height = Math.max(dim.height, r.y + r.height);
}
} }
if(width > 0)
{
dim.width = width;
}
if(height > 0)
{
dim.height = height;
}
Insets insets = target.getInsets();
dim.width += insets.left + insets.right;
dim.height += insets.top + insets.bottom;
return dim;
}
/*
static
{
serialVersionUID = 200L;
}
*/
}
还有个这个怎么办?
如何给别人也能运行,没人改classpath太麻烦了
每个客户端还要有jbcl.jar
怎么办?!?!
然后再html里面德applet中加一个参数
加上archive="xxx.jar"就行了