jdbcexplorer.java

来自「数据仓库展示程序」· Java 代码 · 共 76 行

JAVA
76
字号
/*
 * JDBCExplorer.java
 *
 * Created on October 11, 2002, 12:43 AM
 */

package mondrian.gui;

import java.sql.Connection;

/**
 *
 * @author  sean
 */
public class JDBCExplorer extends javax.swing.JPanel {
    Connection connection;
    JDBCTreeModel model;

    /** Creates new form JDBCExplorer */
    public JDBCExplorer() {
        initComponents();
    }

    public JDBCExplorer(Connection c) {
        this();
        setConnection(c);
    }

    public void setConnection(Connection c) {
        try {
            this.connection = c;

            model = new JDBCTreeModel(c);

            tree.setModel(model);
            //tree.addTreeSelectionListener(this);

        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    /** 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.
     */
    private void initComponents() {//GEN-BEGIN:initComponents
        jSplitPane1 = new javax.swing.JSplitPane();
        jScrollPane1 = new javax.swing.JScrollPane();
        tree = new javax.swing.JTree();
        jScrollPane2 = new javax.swing.JScrollPane();

        setLayout(new java.awt.BorderLayout());

        jSplitPane1.setDividerLocation(200);
        jScrollPane1.setViewportView(tree);

        jSplitPane1.setLeftComponent(jScrollPane1);

        jSplitPane1.setRightComponent(jScrollPane2);

        add(jSplitPane1, java.awt.BorderLayout.CENTER);

    }//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTree tree;
    private javax.swing.JSplitPane jSplitPane1;
    // End of variables declaration//GEN-END:variables

}

⌨️ 快捷键说明

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