62,614
社区成员
发帖
与我相关
我的任务
分享
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class TestDivide extends JFrame{
public TestDivide() {
Container cp=getContentPane();
JSplitPane js=new JSplitPane();
JSplitPane js1=new JSplitPane();
JPanel jp1=new JPanel();
jp1.setBackground(Color.green);
JPanel jp2=new JPanel();
jp2.setBackground(Color.yellow);
JPanel jp3=new JPanel();
jp3.setBackground(Color.pink);
js1.setLeftComponent(jp1);
js1.setRightComponent(jp2);
js.setLeftComponent(js1);
js.setRightComponent(jp3);
cp.add(js);
setSize(400,300);
setVisible(true);
}
public static void main(String sd[]){
TestDivide frm=new TestDivide();
}
}
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class TestDivide extends JFrame{
public TestDivide() {
Container cp=getContentPane();
JSplitPane js=new JSplitPane();
JSplitPane js1=new JSplitPane();
JPanel jp1=new JPanel();
jp1.setBackground(Color.green);
JPanel jp2=new JPanel();
jp2.setBackground(Color.yellow);
JPanel jp3=new JPanel();
jp3.setBackground(Color.pink);
js1.setLeftComponent(jp1);
js1.setRightComponent(jp2);
js1.setDividerLocation(100);
js.setLeftComponent(js1);
js.setRightComponent(jp3);
js.setDividerLocation(300);
cp.add(js);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(400,300);
setVisible(true);
}
public static void main(String sd[]){
TestDivide frm=new TestDivide();
}
}