Example usage for javax.swing ScrollPaneConstants VERTICAL_SCROLLBAR_ALWAYS

List of usage examples for javax.swing ScrollPaneConstants VERTICAL_SCROLLBAR_ALWAYS

Introduction

In this page you can find the example usage for javax.swing ScrollPaneConstants VERTICAL_SCROLLBAR_ALWAYS.

Prototype

int VERTICAL_SCROLLBAR_ALWAYS

To view the source code for javax.swing ScrollPaneConstants VERTICAL_SCROLLBAR_ALWAYS.

Click Source Link

Document

Used to set the vertical scroll bar policy so that vertical scrollbars are always displayed.

Usage

From source file:net.sf.keystore_explorer.gui.dialogs.DViewCertCsrPem.java

private void initComponents() throws CryptoException {
    jbOK = new JButton(res.getString("DViewCertCsrPem.jbOK.text"));

    jbOK.addActionListener(new ActionListener() {
        @Override/*from  ww w. ja v  a2s  .com*/
        public void actionPerformed(ActionEvent evt) {
            okPressed();
        }
    });

    jbCopy = new JButton(res.getString("DViewCertCsrPem.jbCopy.text"));
    PlatformUtil.setMnemonic(jbCopy, res.getString("DViewCertCsrPem.jbCopy.mnemonic").charAt(0));
    if (cert != null) {
        jbCopy.setToolTipText(res.getString("DViewCertCsrPem.jbCertCopy.tooltip"));
    } else {
        jbCopy.setToolTipText(res.getString("DViewCertCsrPem.jbCsrCopy.tooltip"));
    }

    jbCopy.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent evt) {
            try {
                CursorUtil.setCursorBusy(DViewCertCsrPem.this);
                copyPressed();
            } finally {
                CursorUtil.setCursorFree(DViewCertCsrPem.this);
            }
        }
    });

    jbExport = new JButton(res.getString("DViewCertCsrPem.jbExport.text"));
    PlatformUtil.setMnemonic(jbExport, res.getString("DViewCertCsrPem.jbExport.mnemonic").charAt(0));
    if (cert != null) {
        jbExport.setToolTipText(res.getString("DViewCertCsrPem.jbCertExport.tooltip"));
    } else {
        jbExport.setToolTipText(res.getString("DViewCertCsrPem.jbCsrExport.tooltip"));
    }
    jbExport.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent evt) {
            try {
                CursorUtil.setCursorBusy(DViewCertCsrPem.this);
                exportPressed();
            } finally {
                CursorUtil.setCursorFree(DViewCertCsrPem.this);
            }
        }
    });

    jpButtons = PlatformUtil.createDialogButtonPanel(jbOK, null, new JButton[] { jbCopy, jbExport }, true);

    jpPem = new JPanel(new BorderLayout());
    jpPem.setBorder(new EmptyBorder(5, 5, 5, 5));

    if (cert != null) {
        jtaPem = new JTextArea(X509CertUtil.getCertEncodedX509Pem(cert));
    } else {
        jtaPem = new JTextArea(Pkcs10Util.getCsrEncodedDerPem(pkcs10Csr));
    }
    jtaPem.setCaretPosition(0);
    jtaPem.setEditable(false);
    jtaPem.setFont(new Font(Font.MONOSPACED, Font.PLAIN, LnfUtil.getDefaultFontSize()));
    // JGoodies - keep uneditable color same as editable
    jtaPem.putClientProperty("JTextArea.infoBackground", Boolean.TRUE);

    jspPem = PlatformUtil.createScrollPane(jtaPem, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
    jspPem.setPreferredSize(new Dimension(500, 300));
    jpPem.add(jspPem, BorderLayout.CENTER);

    getContentPane().add(jpPem, BorderLayout.CENTER);
    getContentPane().add(jpButtons, BorderLayout.SOUTH);

    setResizable(true);

    addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent evt) {
            closeDialog();
        }
    });

    getRootPane().setDefaultButton(jbOK);

    pack();

    SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            jbOK.requestFocus();
        }
    });
}

From source file:net.sf.mzmine.chartbasics.graphicsexport.GraphicsExportDialog.java

/**
 * Create the dialog./*from   ww  w .java2  s .  co  m*/
 */
public GraphicsExportDialog() {
    final JFrame thisframe = this;
    //
    parameters = new GraphicsExportParameters();
    chartParam = new ChartThemeParameters();
    parametersAndComponents = new HashMap<String, JComponent>();

    String[] formats = parameters.getParameter(GraphicsExportParameters.exportFormat).getChoices();
    chooser.addChoosableFileFilter(new FileTypeFilter(formats, "Export images"));
    chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
    //
    setBounds(100, 100, 808, 795);
    getContentPane().setLayout(new BorderLayout());
    contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    getContentPane().add(contentPanel, BorderLayout.CENTER);
    contentPanel.setLayout(new MigLayout("", "[][][grow]", "[][][][grow]"));
    {
        StringParameter p = parameters.getParameter(GraphicsExportParameters.path);
        StringComponent txtPath = p.createEditingComponent();
        contentPanel.add(txtPath, "flowx,cell 0 0,growx");
        parametersAndComponents.put(p.getName(), txtPath);
    }
    {
        btnPath = new JButton("Path");
        btnPath.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                choosePath();
            }
        });
        contentPanel.add(btnPath, "cell 1 0");
    }
    {
        StringParameter p = parameters.getParameter(GraphicsExportParameters.filename);
        StringComponent txtFileName = p.createEditingComponent();
        contentPanel.add(txtFileName, "cell 0 1,growx");
        parametersAndComponents.put(p.getName(), txtFileName);
    }
    {
        JLabel lblFilename = new JLabel("filename");
        contentPanel.add(lblFilename, "cell 1 1");
    }
    {
        JPanel pnSettingsLeft = new JPanel();
        pnSettingsLeft.setMinimumSize(new Dimension(260, 260));
        contentPanel.add(pnSettingsLeft, "cell 0 3,grow");
        pnSettingsLeft.setLayout(new BorderLayout(0, 0));
        {

            GridBagPanel pn = new GridBagPanel();
            {
                // add unit
                UserParameter p;
                JComponent comp;
                // add unit
                p = (UserParameter) parameters.getParameter(GraphicsExportParameters.unit);
                comp = p.createEditingComponent();
                comp.setToolTipText(p.getDescription());
                comp.setEnabled(true);
                pn.add(comp, 2, 2);
                parametersAndComponents.put(p.getName(), comp);

                int i = 0;
                // add export settings
                Parameter[] param = parameters.getParameters();
                for (int pi = 3; pi < param.length; pi++) {
                    p = (UserParameter) param[pi];
                    comp = p.createEditingComponent();
                    comp.setToolTipText(p.getDescription());
                    comp.setEnabled(true);
                    pn.add(new JLabel(p.getName()), 0, i);
                    pn.add(comp, 1, i, 1, 1, 1, 1);
                    // add to map
                    parametersAndComponents.put(p.getName(), comp);
                    i++;
                }

                // add separator
                pn.add(new JSeparator(), 0, i, 5, 1, 1, 1, GridBagConstraints.BOTH);
                i++;
                // add Apply theme button
                JButton btnApply2 = new JButton("Apply theme");
                btnApply2.addActionListener(e -> applyTheme());
                pn.add(btnApply2, 0, i, 5, 1, 1, 1, GridBagConstraints.BOTH);
                i++;

                // add chart settings
                param = chartParam.getParameters();
                for (int pi = 0; pi < param.length; pi++) {
                    p = (UserParameter) param[pi];
                    comp = p.createEditingComponent();
                    comp.setToolTipText(p.getDescription());
                    comp.setEnabled(true);
                    pn.add(new JLabel(p.getName()), 0, i);
                    pn.add(comp, 1, i, 4, 1);
                    // add to map
                    parametersAndComponents.put(p.getName(), comp);
                    i++;
                }

                // add listener to master font
                JFontSpecs master = (JFontSpecs) parametersAndComponents
                        .get(chartParam.getParameter(ChartThemeParameters.masterFont).getName());
                master.addListener(fspec -> {
                    if (listenersEnabled)
                        handleMasterFontChanged(fspec);
                });
            }

            JScrollPane scrollPane = new JScrollPane(pn);
            scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
            pnSettingsLeft.add(scrollPane, BorderLayout.CENTER);
            scrollPane.getVerticalScrollBar().setUnitIncrement(18);
            scrollPane.revalidate();
            scrollPane.repaint();
        }
    }
    {
        {
            pnChartPreview = new JPanel();
            pnChartPreview.setLayout(null);
            contentPanel.add(pnChartPreview, "cell 1 3 2 1,grow");
        }
    }
    {
        JPanel buttonPane = new JPanel();
        buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
        getContentPane().add(buttonPane, BorderLayout.SOUTH);
        {
            JButton okButton = new JButton("Save");
            okButton.addActionListener(e -> saveGraphicsAs());
            okButton.setActionCommand("OK");
            buttonPane.add(okButton);
            getRootPane().setDefaultButton(okButton);
        }
        {
            btnRenewPreview = new JButton("Renew Preview");
            btnRenewPreview.addActionListener(e -> renewPreview());
            buttonPane.add(btnRenewPreview);
        }
        {
            btnApply = new JButton("Apply theme");
            btnApply.addActionListener(e -> applyTheme());
            buttonPane.add(btnApply);
        }
        {
            JButton cancelButton = new JButton("Cancel");
            cancelButton.addActionListener(e -> setVisible(false));
            cancelButton.setActionCommand("Cancel");
            buttonPane.add(cancelButton);
        }
    }
    // set all to components
    updateComponentsFromParameters();
}

From source file:edu.ku.brc.af.tasks.subpane.formeditor.ViewSetSelectorPanel.java

/**
 * //from ww  w  . ja v a  2 s.  co m
 */
@SuppressWarnings("unchecked") //$NON-NLS-1$
public ViewSetSelectorPanel(final BasicFormPreviewPanel previewPanel) {
    this.previewPanel = previewPanel;

    Vector<String> levelsVec = new Vector<String>();
    SpecifyUser user = AppContextMgr.getInstance().getClassObject(SpecifyUser.class);
    @SuppressWarnings("unused")
    Hashtable<Discipline, Boolean> usedColTypes = new Hashtable<Discipline, Boolean>();

    levelsVec.add(user.getUserType());

    //        for (Agent agent : user.getAgents())
    //        {
    //            // XXX Commented Out
    //            /*Discipline ct = agent.getDiscipline();
    //            if (usedColTypes.get(ct) == null)
    //            {
    //                levelsVec.add(ct.getName());
    //                usedColTypes.put(ct, true);
    //            }*/
    //        }
    levelsVec.add("BackStop"); //$NON-NLS-1$

    addBtn = UIHelper.createIconBtn("PlusSign", "", new ActionListener() { //$NON-NLS-1$ //$NON-NLS-2$
        public void actionPerformed(ActionEvent arg0) {
            addControl();
        }
    });

    delBtn = UIHelper.createIconBtn("MinusSign", "", new ActionListener() { //$NON-NLS-1$ //$NON-NLS-2$
        public void actionPerformed(ActionEvent arg0) {
            delControl(TYPE.SelectedObj);
        }
    });

    ActionListener addViewAL = new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            addView();
        }
    };

    ActionListener delViewAL = new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            delView();
        }
    };

    viewControlPanel = new EditDeleteAddPanel(null, delViewAL, addViewAL);

    ActionListener addAltViewAL = new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            addAltView();
        }
    };

    ActionListener delAltViewAL = new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            delAltView();
        }
    };

    altViewControlPanel = new EditDeleteAddPanel(null, delAltViewAL, addAltViewAL);

    ActionListener addDefViewAL = new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            addViewDef();
        }
    };

    ActionListener delDefViewAL = new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            delViewDef();
        }
    };

    viewDefControlPanel = new EditDeleteAddPanel(null, delDefViewAL, addDefViewAL);

    ActionListener saveAL = new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            save();
        }
    };
    EditDeleteAddPanel saveControlPanel = new EditDeleteAddPanel(null, null, saveAL);
    saveControlPanel.getAddBtn().setIcon(IconManager.getIcon("Save", IconManager.IconSize.Std16)); //$NON-NLS-1$
    saveControlPanel.getAddBtn().setEnabled(true);

    setLayout(new BorderLayout());

    levelsList = new JList(levelsVec);
    panel = new EditorPropPanel(controlHash, subcontrolHash, null, true, this);
    //panel.setFormViewDef(null);

    PanelBuilder pb = new PanelBuilder(new FormLayout("p,4px,p, 6px,10px,6px, p,6px,p, 6px,10px,6px, p,f:p:g", //$NON-NLS-1$
            "p,2px,f:p:g,2px,p,10px,p,4px")); //$NON-NLS-1$
    CellConstraints cc = new CellConstraints();

    String[] labels = new String[] { "User Level", "ViewSets", " ", "Views", "AltViews", " ", "View Defs" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$
    int x = 1;
    for (String label : labels) {
        pb.add(createLabel(label, SwingConstants.CENTER), cc.xy(x, 1));
        x += 2;
    }

    Color vsFGColor = new Color(224, 224, 224);
    Color vsBGColor = new Color(124, 124, 124);

    Dimension ps = new Dimension(200, 150);

    x = 1;
    JScrollPane sp = createScrollPane(levelsList);
    pb.add(sp, cc.xy(x, 3));
    x += 2;

    viewSetsList = new JList(new DefaultListModel());
    sp = createScrollPane(viewSetsList);
    sp.setPreferredSize(ps);
    pb.add(sp, cc.xy(x, 3));
    x += 2;

    pb.add(new VerticalSeparator(vsFGColor, vsBGColor), cc.xy(x, 3));
    x += 2;

    viewsList = new JList(new DefaultListModel());
    sp = new JScrollPane(viewsList, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    sp.setPreferredSize(ps);
    pb.add(sp, cc.xy(x, 3));
    x += 2;

    altViewsList = new JList(new DefaultListModel());
    sp = createScrollPane(altViewsList);
    sp.setPreferredSize(ps);
    pb.add(sp, cc.xy(x, 3));
    x += 2;

    pb.add(new VerticalSeparator(vsFGColor, vsBGColor), cc.xy(x, 3));
    x += 2;

    viewDefsList = new JList(new DefaultListModel());
    sp = createScrollPane(viewDefsList);
    sp.setPreferredSize(ps);
    pb.add(sp, cc.xy(x, 3));
    x += 2;

    pb.add(saveControlPanel, cc.xy(1, 5));
    //pb.add(createLabel(" "),     cc.xy(3, 5));
    //pb.add(createLabel(" "),     cc.xy(5, 5));
    pb.add(viewControlPanel, cc.xy(7, 5));
    pb.add(altViewControlPanel, cc.xy(9, 5));
    //pb.add(createLabel(" "),     cc.xy(11, 5));
    pb.add(viewDefControlPanel, cc.xy(13, 5));

    pb.addSeparator("View Def Editor", cc.xywh(1, 7, 13, 1)); //$NON-NLS-1$

    add(pb.getPanel(), BorderLayout.NORTH);

    pb = new PanelBuilder(new FormLayout("max(250px;p),4px,f:p:g", "t:p")); //$NON-NLS-1$ //$NON-NLS-2$

    PanelBuilder inner = new PanelBuilder(new FormLayout("max(250px;p)", "t:p,2px,t:p")); //$NON-NLS-1$ //$NON-NLS-2$
    tree = new JTree();
    ((DefaultTreeModel) tree.getModel()).setRoot(null);
    sp = createScrollPane(tree);
    inner.add(sp, cc.xy(1, 1));

    PanelBuilder btnPb = new PanelBuilder(new FormLayout("f:p:g,p,2px,p", "p")); //$NON-NLS-1$ //$NON-NLS-2$
    btnPb.add(delBtn, cc.xy(2, 1));
    btnPb.add(addBtn, cc.xy(4, 1));
    inner.add(btnPb.getPanel(), cc.xy(1, 3));

    pb.add(inner.getPanel(), cc.xy(1, 1));
    pb.add(panel, cc.xy(3, 1));

    add(pb.getPanel(), BorderLayout.CENTER);

    tree.addTreeSelectionListener(new TreeSelectionListener() {
        public void valueChanged(TreeSelectionEvent e) {
            treeSelected();
        }
    });

    levelsList.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(ListSelectionEvent e) {
            if (!e.getValueIsAdjusting()) {
                levelSelected();
            }
        }
    });

    viewSetsList.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(ListSelectionEvent e) {
            if (!e.getValueIsAdjusting()) {
                viewSetSelected();
            }
        }
    });

    viewsList.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(ListSelectionEvent e) {
            if (!e.getValueIsAdjusting()) {
                viewSelected();
            }
        }
    });

    altViewsList.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(ListSelectionEvent e) {
            if (!e.getValueIsAdjusting()) {
                altViewSelected();
            }
        }
    });

    viewDefsList.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
        public void valueChanged(ListSelectionEvent e) {
            if (!e.getValueIsAdjusting()) {
                viewDefSelected();
            }
        }
    });

    tree.addMouseListener(new MouseAdapter() {

        protected void doPopup(MouseEvent e) {
            if (e.isPopupTrigger()) {
                int xc = e.getX();
                int yc = e.getY();
                TreePath path = tree.getPathForLocation(xc, yc);
                if (path != null) {
                    tree.setSelectionPath(path);
                }

                treeSelected();

                DefaultMutableTreeNode selectedNode = (DefaultMutableTreeNode) tree.getSelectionModel()
                        .getSelectionPath().getLastPathComponent();

                if (selectedCell != null || selectedRow != null) {
                    new TreePopupMenu((Component) e.getSource(), e, selectedCell);

                } else if (selectedNode.getUserObject() instanceof FormViewDef) {
                    new TreePopupMenu((Component) e.getSource(), e);
                }
            }
        }

        public void mouseReleased(MouseEvent e) {
            doPopup(e);
        }

        public void mousePressed(MouseEvent e) {
            doPopup(e);
        }
    });

    XStream xstream = new XStream();
    xstream.alias("control", Control.class); //$NON-NLS-1$
    xstream.useAttributeFor(Control.class, "type"); //$NON-NLS-1$
    xstream.useAttributeFor(Attr.class, "type"); //$NON-NLS-1$
    xstream.useAttributeFor(Attr.class, "name"); //$NON-NLS-1$
    xstream.useAttributeFor(Attr.class, "required"); //$NON-NLS-1$
    xstream.useAttributeFor(Attr.class, "defaultValue"); //$NON-NLS-1$
    xstream.aliasAttribute("default", "defaultValue"); //$NON-NLS-1$ //$NON-NLS-2$

    xstream.alias("uicontrols", Vector.class); //$NON-NLS-1$
    xstream.alias("attr", Attr.class); //$NON-NLS-1$
    xstream.alias("param", Param.class); //$NON-NLS-1$
    xstream.alias("subcontrol", SubControl.class); //$NON-NLS-1$
    xstream.aliasAttribute("desc", "desc"); //$NON-NLS-1$ //$NON-NLS-2$
    xstream.aliasAttribute(Attr.class, "values", "values"); //$NON-NLS-1$ //$NON-NLS-2$
    xstream.useAttributeFor(SubControl.class, "type"); //$NON-NLS-1$

    try {
        controls = (Vector<Control>) xstream.fromXML(FileUtils.readFileToString(new File("UIControls.xml"))); //$NON-NLS-1$
        for (Control control : controls) {
            controlHash.put(control.getType(), control);
            if (control.getSubcontrols() != null) {
                for (SubControl sc : control.getSubcontrols()) {
                    //System.out.println(" ["+sc.getType()+"]  ");
                    subcontrolHash.put(sc.getType(), sc);
                }
            }
        }

    } catch (IOException ex) {
        edu.ku.brc.af.core.UsageTracker.incrHandledUsageCount();
        edu.ku.brc.exceptions.ExceptionTracker.getInstance().capture(ViewSetSelectorPanel.class, ex);
        ex.printStackTrace();
    }
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskSwing.CFAsteriskSwingSysClusterFinderJPanel.java

public CFAsteriskSwingSysClusterFinderJPanel(ICFAsteriskSwingSchema argSchema) {
    super();/*from  w ww .ja  v a  2s .  co m*/
    final String S_ProcName = "construct-schema-focus";
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "argSchema");
    }
    swingSchema = argSchema;
    dataTable = new JTable(getDataModel(), getDataColumnModel(), getDataListSelectionModel());
    dataTable.addMouseListener(getDataListMouseAdapter());
    dataTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    dataTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    dataTable.setUpdateSelectionOnSort(true);
    dataTable.setRowHeight(25);
    getDataListSelectionModel().addListSelectionListener(getDataListSelectionListener());
    dataScrollPane = new JScrollPane(dataTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    dataScrollPane.setColumnHeader(new JViewport() {
        @Override
        public Dimension getPreferredSize() {
            Dimension sz = super.getPreferredSize();
            sz.height = 25;
            return (sz);
        }
    });
    dataTable.setFillsViewportHeight(true);
    add(dataScrollPane);
    loadData(true);
    doLayout();
    swingIsInitializing = false;
}

From source file:net.sourceforge.msscodefactory.cfcrm.v2_1.CFCrmSwing.CFCrmSwingTldFinderJPanel.java

public CFCrmSwingTldFinderJPanel(ICFCrmSwingSchema argSchema) {
    super();//from w ww  .ja va 2  s  . c o  m
    final String S_ProcName = "construct-schema-focus";
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "argSchema");
    }
    swingSchema = argSchema;
    dataTable = new JTable(getDataModel(), getDataColumnModel(), getDataListSelectionModel());
    dataTable.addMouseListener(getDataListMouseAdapter());
    dataTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    dataTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    dataTable.setUpdateSelectionOnSort(true);
    dataTable.setRowHeight(25);
    getDataListSelectionModel().addListSelectionListener(getDataListSelectionListener());
    dataScrollPane = new JScrollPane(dataTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    dataScrollPane.setColumnHeader(new JViewport() {
        @Override
        public Dimension getPreferredSize() {
            Dimension sz = super.getPreferredSize();
            sz.height = 25;
            return (sz);
        }
    });
    dataTable.setFillsViewportHeight(true);
    add(dataScrollPane);
    loadData(true);
    doLayout();
    swingIsInitializing = false;
}

From source file:net.sourceforge.msscodefactory.cfinternet.v2_0.CFInternetSwing.CFInternetSwingTldFinderJPanel.java

public CFInternetSwingTldFinderJPanel(ICFInternetSwingSchema argSchema) {
    super();//  w  w w  .jav a  2 s.  co  m
    final String S_ProcName = "construct-schema-focus";
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "argSchema");
    }
    swingSchema = argSchema;
    dataTable = new JTable(getDataModel(), getDataColumnModel(), getDataListSelectionModel());
    dataTable.addMouseListener(getDataListMouseAdapter());
    dataTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    dataTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    dataTable.setUpdateSelectionOnSort(true);
    dataTable.setRowHeight(25);
    getDataListSelectionModel().addListSelectionListener(getDataListSelectionListener());
    dataScrollPane = new JScrollPane(dataTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    dataScrollPane.setColumnHeader(new JViewport() {
        @Override
        public Dimension getPreferredSize() {
            Dimension sz = super.getPreferredSize();
            sz.height = 25;
            return (sz);
        }
    });
    dataTable.setFillsViewportHeight(true);
    add(dataScrollPane);
    loadData(true);
    doLayout();
    swingIsInitializing = false;
}

From source file:net.sourceforge.msscodefactory.cfcrm.v2_0.CFCrmSwing.CFCrmSwingSecUserFinderJPanel.java

public CFCrmSwingSecUserFinderJPanel(ICFCrmSwingSchema argSchema) {
    super();/*  w w  w.j a v  a  2s .c o  m*/
    final String S_ProcName = "construct-schema-focus";
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "argSchema");
    }
    swingSchema = argSchema;
    dataTable = new JTable(getDataModel(), getDataColumnModel(), getDataListSelectionModel());
    dataTable.addMouseListener(getDataListMouseAdapter());
    dataTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    dataTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    dataTable.setUpdateSelectionOnSort(true);
    dataTable.setRowHeight(25);
    getDataListSelectionModel().addListSelectionListener(getDataListSelectionListener());
    dataScrollPane = new JScrollPane(dataTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    dataScrollPane.setColumnHeader(new JViewport() {
        @Override
        public Dimension getPreferredSize() {
            Dimension sz = super.getPreferredSize();
            sz.height = 25;
            return (sz);
        }
    });
    dataTable.setFillsViewportHeight(true);
    add(dataScrollPane);
    loadData(true);
    doLayout();
    swingIsInitializing = false;
}

From source file:net.sourceforge.msscodefactory.cfinternet.v2_0.CFInternetSwing.CFInternetSwingTenantFinderJPanel.java

public CFInternetSwingTenantFinderJPanel(ICFInternetSwingSchema argSchema) {
    super();// ww  w  .j  av a  2  s . co  m
    final String S_ProcName = "construct-schema-focus";
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "argSchema");
    }
    swingSchema = argSchema;
    dataTable = new JTable(getDataModel(), getDataColumnModel(), getDataListSelectionModel());
    dataTable.addMouseListener(getDataListMouseAdapter());
    dataTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    dataTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    dataTable.setUpdateSelectionOnSort(true);
    dataTable.setRowHeight(25);
    getDataListSelectionModel().addListSelectionListener(getDataListSelectionListener());
    dataScrollPane = new JScrollPane(dataTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    dataScrollPane.setColumnHeader(new JViewport() {
        @Override
        public Dimension getPreferredSize() {
            Dimension sz = super.getPreferredSize();
            sz.height = 25;
            return (sz);
        }
    });
    dataTable.setFillsViewportHeight(true);
    add(dataScrollPane);
    loadData(true);
    doLayout();
    swingIsInitializing = false;
}

From source file:net.sourceforge.msscodefactory.cfinternet.v2_0.CFInternetSwing.CFInternetSwingClusterFinderJPanel.java

public CFInternetSwingClusterFinderJPanel(ICFInternetSwingSchema argSchema) {
    super();/*from ww w  .ja  v a2  s. c o m*/
    final String S_ProcName = "construct-schema-focus";
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "argSchema");
    }
    swingSchema = argSchema;
    dataTable = new JTable(getDataModel(), getDataColumnModel(), getDataListSelectionModel());
    dataTable.addMouseListener(getDataListMouseAdapter());
    dataTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    dataTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    dataTable.setUpdateSelectionOnSort(true);
    dataTable.setRowHeight(25);
    getDataListSelectionModel().addListSelectionListener(getDataListSelectionListener());
    dataScrollPane = new JScrollPane(dataTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    dataScrollPane.setColumnHeader(new JViewport() {
        @Override
        public Dimension getPreferredSize() {
            Dimension sz = super.getPreferredSize();
            sz.height = 25;
            return (sz);
        }
    });
    dataTable.setFillsViewportHeight(true);
    add(dataScrollPane);
    loadData(true);
    doLayout();
    swingIsInitializing = false;
}

From source file:net.sourceforge.msscodefactory.cfasterisk.v2_4.CFAsteriskSwing.CFAsteriskSwingTldFinderJPanel.java

public CFAsteriskSwingTldFinderJPanel(ICFAsteriskSwingSchema argSchema) {
    super();/*from  w ww  . jav a  2  s  .  c o m*/
    final String S_ProcName = "construct-schema-focus";
    if (argSchema == null) {
        throw CFLib.getDefaultExceptionFactory().newNullArgumentException(getClass(), S_ProcName, 1,
                "argSchema");
    }
    swingSchema = argSchema;
    dataTable = new JTable(getDataModel(), getDataColumnModel(), getDataListSelectionModel());
    dataTable.addMouseListener(getDataListMouseAdapter());
    dataTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    dataTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
    dataTable.setUpdateSelectionOnSort(true);
    dataTable.setRowHeight(25);
    getDataListSelectionModel().addListSelectionListener(getDataListSelectionListener());
    dataScrollPane = new JScrollPane(dataTable, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
            ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
    dataScrollPane.setColumnHeader(new JViewport() {
        @Override
        public Dimension getPreferredSize() {
            Dimension sz = super.getPreferredSize();
            sz.height = 25;
            return (sz);
        }
    });
    dataTable.setFillsViewportHeight(true);
    add(dataScrollPane);
    loadData(true);
    doLayout();
    swingIsInitializing = false;
}