import java.awt.*;
import javax.swing.*;
public class ExampleFrame_01 extends JFrame{
private static final long serialVersionUID = 1L;
public static void main(String[] args) {
ExampleFrame_01 Frame=new ExampleFrame_01();
Frame.setVisible(true);
}
public Example_01(){
super();
setTitle("分割面板");
setBounds(100,100,500,375);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
final JSplitPane hSplitPane=new JSplitPane();
hSplitPane.setDividerLocation(40);
getContentPane().add(hSplitPane,BorderLayout.CENTER);
hSplitPane.setLeftComponent(new JLabel(" 1"));
final JSplitPane vSplitPane=new JSplitPane(JSplitPane.VERTICAL_SPLIT);
vSplitPane.setDividerLocation(30);
vSplitPane.setDividerSize(8);
vSplitPane.setOneTouchExpandable(true);
hSplitPane.setRightComponent(vSplitPane);
vSplitPane.setTopComponent(new JLabel(" 2"));
vSplitPane.setBottomComponent(new JLabel(" 3"));
}
}
下划线那两行报错。why?
zeng_建军
相关分类