import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import javax.swing.*;/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2002</p>
* <p>Company: </p>
* @author unascribed
* @version 1.0
*/public class Applet3 extends Applet {
boolean isStandalone = false;
JPanel jPanel1 = new JPanel();
BorderLayout borderLayout1 = new BorderLayout();
JSplitPane jSplitPane1 = new JSplitPane();
BorderLayout borderLayout2 = new BorderLayout();
JSplitPane img_msgpane = new JSplitPane();
JPanel imgpane = new JPanel();
JPanel msgpane = new JPanel();
JPanel treepane = new JPanel(); //Construct the applet
public Applet3() {
}
//Initialize the applet
public void init() {
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
//Component initialization
private void jbInit() throws Exception {
jSplitPane1.setDividerLocation(0.3);
img_msgpane.setDividerLocation(0.5); this.setLayout(borderLayout1);
jPanel1.setLayout(borderLayout2);
img_msgpane.setOrientation(JSplitPane.VERTICAL_SPLIT);
img_msgpane.setDividerSize(1);
jSplitPane1.setDividerSize(1);
this.add(jPanel1, BorderLayout.CENTER);
jPanel1.add(jSplitPane1, BorderLayout.CENTER);
jSplitPane1.add(img_msgpane, JSplitPane.RIGHT);
img_msgpane.add(imgpane, JSplitPane.TOP);
img_msgpane.add(msgpane, JSplitPane.BOTTOM);
jSplitPane1.add(treepane, JSplitPane.LEFT);
}
//Get Applet information
public String getAppletInfo() {
return "Applet Information";
}
//Get parameter info
public String[][] getParameterInfo() {
return null;
}
}
为什么不用 JBuilder 呢
但是你的程序我试了试,与想象的结果也不一样,不知道是程序的问题还是我的运行环境的问题。
用jbuilder设置这些效果好像也挺麻烦!
请各位进一步赐教!
http://developer.java.sun.com/developer/bugParade/bugs/4182558.html
一个简单的解决方法是在setDividerLocation(double);之前调用JFrame.validate()。
to dutzzl ():抱歉现在才回复。希望还不算太晚。一个不好的消息是,SUN将不会修正这个Bug。