⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 demojsplitpaneframe.java

📁 精通NetBeans光盘源代码,很好很好的资料
💻 JAVA
字号:
/*
 * DemoJSplitPaneFrame.java
 *
 * Created on 2006年3月19日, 上午11:56
 */

package org.netbeans.swing.container;

/**
 *
 * @author  boyingking
 */
public class DemoJSplitPaneFrame extends javax.swing.JFrame {
    
    /** Creates new form DemoJSplitPaneFrame */
    public DemoJSplitPaneFrame() {
        initComponents();
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        jPanelGlobal = new javax.swing.JPanel();
        jSplitPaneGlobal = new javax.swing.JSplitPane();
        jLabelLeft = new javax.swing.JLabel();
        jLabelRight = new javax.swing.JLabel();
        jButtonReset = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("JSplitPane\u5e94\u7528\u793a\u4f8b");
        jSplitPaneGlobal.setDividerLocation(200);
        jSplitPaneGlobal.setDividerSize(3);
        jLabelLeft.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelLeft.setText("\u8fd9\u662fjSplitPaneGlobal\u7684\u5de6\u90e8");
        jSplitPaneGlobal.setLeftComponent(jLabelLeft);

        jLabelRight.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabelRight.setText("\u8fd9\u662fjSplitPaneGlobal\u7684\u53f3\u90e8");
        jSplitPaneGlobal.setRightComponent(jLabelRight);

        org.jdesktop.layout.GroupLayout jPanelGlobalLayout = new org.jdesktop.layout.GroupLayout(jPanelGlobal);
        jPanelGlobal.setLayout(jPanelGlobalLayout);
        jPanelGlobalLayout.setHorizontalGroup(
            jPanelGlobalLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanelGlobalLayout.createSequentialGroup()
                .add(jSplitPaneGlobal, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 456, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanelGlobalLayout.setVerticalGroup(
            jPanelGlobalLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jSplitPaneGlobal, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 79, Short.MAX_VALUE)
        );

        jButtonReset.setText("\u8fd8\u539f");
        jButtonReset.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonResetActionPerformed(evt);
            }
        });

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(layout.createSequentialGroup()
                        .add(187, 187, 187)
                        .add(jButtonReset))
                    .add(layout.createSequentialGroup()
                        .add(31, 31, 31)
                        .add(jPanelGlobal, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(30, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(21, 21, 21)
                .add(jPanelGlobal, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .add(23, 23, 23)
                .add(jButtonReset)
                .addContainerGap(164, Short.MAX_VALUE))
        );
        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButtonResetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonResetActionPerformed
// TODO add your handling code here:
       this.jSplitPaneGlobal.setDividerLocation(200);
    }//GEN-LAST:event_jButtonResetActionPerformed
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new DemoJSplitPaneFrame().setVisible(true);
            }
        });
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonReset;
    private javax.swing.JLabel jLabelLeft;
    private javax.swing.JLabel jLabelRight;
    private javax.swing.JPanel jPanelGlobal;
    private javax.swing.JSplitPane jSplitPaneGlobal;
    // End of variables declaration//GEN-END:variables
    
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -