日期:2014-05-20 浏览次数:20859 次
import java.awt.HeadlessException; import javax.swing.JDialog; import javax.swing.JLabel; import javax.swing.JSplitPane; public class TestSplitPane extends JDialog { public TestSplitPane() throws HeadlessException { initialize(); } private void initialize() { this.setTitle("Test Split Pane"); this.setSize(587, 449); JSplitPane splitPane = new JSplitPane(); splitPane.setDividerLocation(100); splitPane.setLeftComponent(new JLabel("Left")); splitPane.setRightComponent(new JLabel("Right")); this.add(splitPane); } public static void main(String[] args) { TestSplitPane md = new TestSplitPane(); md.setVisible(true); } }