十万火急:为什么在浏览时只有鼠标移动到控件上才会显示其内容??
代码如下:
***file:sbjx.yfsy.abc.java -------------------------
package sbjx.yfsy;
import java.awt.*;
import com.borland.jbcl.layout.*;
import com.borland.jbcl.layout.XYLayout;
import javax.swing.*;
public class abc extends JPanel {
XYLayout xYLayout1 = new XYLayout();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
public abc() {
try {
jbInit();
}
catch(Exception ex) {
ex.printStackTrace();
}
}
void jbInit() throws Exception {
jButton1.setText("jButton1");
this.setBackground(Color.blue);
xYLayout1.setWidth(247);
xYLayout1.setHeight(48);
this.setLayout(xYLayout1);
jButton2.setText("jButton2");
this.add(jButton1, new XYConstraints(22, 13, 69, 21));
this.add(jButton2, new XYConstraints(142, 11, 75, 22));
}
}
***file:sbjx.yfsy.yfsymain.java -------------------------
package sbjx.yfsy;
import java.awt.*;
import java.applet.*;
import javax.swing.*;
import com.borland.jbcl.layout.*;
import com.borland.jbcl.layout.XYLayout;
public class yfsymain extends Applet{
XYLayout xYLayout1 = new XYLayout();
abc sec;
public void init(){
}
public void paint(Graphics g){
}
public yfsymain() {
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
this.setLayout(xYLayout1);
sec=new abc();
this.add(sec, new XYConstraints(22, 13, 262, -1));
}
}
***file:root\yfsymain.html -------------------------
<html>
<body>
<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
codeBase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0"
width=600
height=420
align=center>
<param name="code" value="sbjx.yfsy.yfsymain.class">
</OBJECT>
</body>
</html>
使用Win2000s,JB6,Tomcat4.0.1
控件只有鼠标移动在控件上才能显示其内容,如何才能够一运行就显示其内容??
本人无力解决,请各位高手相助。谢谢!!!