JSplitPane

来源:互联网 发布:ios AFN上传图片数组 编辑:程序博客网 时间:2024/05/22 05:20

JSplitPane



package com.maxenmed.monitersever.mainframe;import javax.swing.*;import javax.swing.plaf.metal.*;import ch.randelshofer.quaqua.QuaquaManager;import java.awt.*;import java.awt.event.*;/** * @ClassName: MainFrame * @Description: TODO(监护仪云服务器主界面) * @author 张洪波 * @date 2011-8-29 上午09:28:05 *  */public class MainFrame extends JFrame{JSplitPane splitpane_123_456;JSplitPane splitpane_1_23;JSplitPane splitpane_4_56;JSplitPane splitpane_2_3;JSplitPane splitpane_5_6;int SCREENWITH = 1920;int SCREENHEIGHT = 1080;MainFrame(){initComponents();setExtendedState(Frame.MAXIMIZED_BOTH);setVisible(true);Container con = getContentPane();con.add(splitpane_123_456);this.setBounds(0, 0, 1920, 1080);validate();setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);}/** * 〈初始化框架〉 * 〈设置主题和框架划分〉 * @return  [void] * @exception/throws [Exception] [主题包不存在等原因] * @since [1.0] * @deprecated */private void initComponents(){try{System.setProperty("Quaqua.TabbedPane.design", "jaguar");String lafClassName = QuaquaManager.getLookAndFeelClassName();UIManager.setLookAndFeel(lafClassName);}catch (Exception e){e.printStackTrace();}JButton label1 = new JButton("1");JButton label2 = new JButton("2");JButton label3 = new JButton("3");JButton label4 = new JButton("4");JButton label5 = new JButton("5");JButton label6 = new JButton("6");splitpane_2_3 = new JSplitPane(JSplitPane.VERTICAL_SPLIT, false,label2,label3);splitpane_5_6 = new JSplitPane(JSplitPane.VERTICAL_SPLIT, false,label5,label6);splitpane_1_23 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, false,label1,splitpane_2_3);splitpane_4_56 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, false,label4,splitpane_5_6);splitpane_123_456 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, false,splitpane_1_23,splitpane_4_56);splitpane_123_456.setDividerLocation(SCREENWITH/2);splitpane_2_3.setDividerLocation(SCREENHEIGHT*7/10);splitpane_5_6.setDividerLocation(SCREENHEIGHT*7/10);splitpane_1_23.setDividerLocation(SCREENWITH/10);splitpane_4_56.setDividerLocation(SCREENWITH/10);}public static void main(String[] agrgs){new MainFrame();}}


原创粉丝点击