Example usage for javax.swing BorderFactory createTitledBorder

List of usage examples for javax.swing BorderFactory createTitledBorder

Introduction

In this page you can find the example usage for javax.swing BorderFactory createTitledBorder.

Prototype

public static TitledBorder createTitledBorder(Border border, String title, int titleJustification,
        int titlePosition, Font titleFont, Color titleColor) 

Source Link

Document

Adds a title to an existing border, with the specified positioning, font and color.

Usage

From source file:com.sec.ose.osi.ui.dialog.setting.JPanProjectAnalysisSetting.java

/**
 * This method initializes jIntMainPanel   
 *    /*from   w  w  w .j av a2 s.co m*/
 * @return javax.swing.JPanel   
 */
private JPanel getJIntMainPanel() {
    if (jIntMainPanel == null) {

        GridBagConstraints gridBagConstraintsSplit = new GridBagConstraints();
        gridBagConstraintsSplit.anchor = GridBagConstraints.NORTHWEST;
        gridBagConstraintsSplit.weighty = 1.0;
        gridBagConstraintsSplit.insets = new Insets(5, 5, 0, 5);
        gridBagConstraintsSplit.fill = GridBagConstraints.HORIZONTAL;
        gridBagConstraintsSplit.weightx = 1.0;

        GridBagConstraints gridBagConstraintsMonitor = new GridBagConstraints();
        gridBagConstraintsMonitor.anchor = GridBagConstraints.WEST;
        gridBagConstraintsMonitor.weighty = 1.0;
        gridBagConstraintsMonitor.insets = new Insets(5, 5, 0, 5);
        gridBagConstraintsMonitor.gridx = 0;
        gridBagConstraintsMonitor.gridy = 1;
        gridBagConstraintsMonitor.fill = GridBagConstraints.HORIZONTAL;
        gridBagConstraintsMonitor.weightx = 1.0;

        jIntMainPanel = new JPanel();
        jIntMainPanel.setLayout(new GridBagLayout());
        jIntMainPanel.setBorder(BorderFactory.createTitledBorder(null, "", TitledBorder.DEFAULT_JUSTIFICATION,
                TitledBorder.DEFAULT_POSITION, new Font("Dialog", Font.BOLD, 12), new Color(51, 51, 51)));
        jIntMainPanel.add(getJPanelProjectSplit(), gridBagConstraintsSplit);
        jIntMainPanel.add(getJPanelMonitorInterval(), gridBagConstraintsMonitor);
    }
    return jIntMainPanel;
}

From source file:com.sec.ose.osi.ui.frm.main.manage.JPanManageMain.java

/**
 * This method initializes jPanelProjectList   
 *    /*from   ww w .  ja  v  a2  s. co m*/
 * @return javax.swing.JPanel   
 */
private JPanel getJPanelProjectList() {
    if (jPanelProjectList == null) {
        GridBagConstraints gridBagConstraints8 = new GridBagConstraints();
        gridBagConstraints8.anchor = GridBagConstraints.EAST;
        gridBagConstraints8.weightx = 0.1;
        gridBagConstraints8.insets = new Insets(0, 0, 0, 10);
        GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
        gridBagConstraints2.anchor = GridBagConstraints.CENTER;
        gridBagConstraints2.insets = new Insets(0, 0, 0, 10);
        GridBagConstraints gridBagConstraints = new GridBagConstraints();
        gridBagConstraints.fill = GridBagConstraints.BOTH;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.weightx = 1.0;
        gridBagConstraints.weighty = 1.0;
        gridBagConstraints.gridwidth = 3;
        gridBagConstraints.insets = new Insets(10, 10, 10, 10);
        gridBagConstraints.gridx = 0;
        jPanelProjectList = new JPanel();
        jPanelProjectList.setLayout(new GridBagLayout());
        jPanelProjectList.setBorder(BorderFactory.createTitledBorder(null, "Project",
                TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION,
                new Font("Dialog", Font.BOLD, 12), new Color(51, 51, 51)));
        jPanelProjectList.add(getJButtonAdd(), gridBagConstraints8);
        jPanelProjectList.add(getJButtonCreate(), gridBagConstraints2);
        jPanelProjectList.add(getJScrollPanePjtList(), gridBagConstraints);
    }
    return jPanelProjectList;
}

From source file:com.sec.ose.osi.ui.frm.main.identification.codematch.JPanCodeMatchMain.java

/**
 * This method initializes jPanel1   /*  w  ww .  j a va 2 s .c  o  m*/
 *    
 * @return javax.swing.JPanel   
 */
public JSplitPane getJSplitPaneSourceCode() {
    if (jSplitPaneSourceCode == null) {
        GridBagConstraints gridBagConstraints14 = new GridBagConstraints();
        gridBagConstraints14.fill = GridBagConstraints.BOTH;
        gridBagConstraints14.weighty = 1.0;
        gridBagConstraints14.weightx = 1.0;
        GridBagConstraints gridBagConstraints17 = new GridBagConstraints();
        gridBagConstraints17.fill = GridBagConstraints.BOTH;
        gridBagConstraints17.weighty = 1.0;
        gridBagConstraints17.weightx = 1.0;
        jSplitPaneSourceCode = new JSplitPane();
        jSplitPaneSourceCode.setBorder(BorderFactory.createTitledBorder(null, "Source Code",
                TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION,
                new Font("Dialog", Font.BOLD, 12), new Color(51, 51, 51)));
        jSplitPaneSourceCode.setDividerSize(5);
        jSplitPaneSourceCode.setLeftComponent(getJPanMatchedSourceViewLeft());
        jSplitPaneSourceCode.setRightComponent(getJPanMatchedSourceViewRight());

        PropertyChangeListener propertyChangeListener = new PropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent changeEvent) {
                String propertyName = changeEvent.getPropertyName();
                if (propertyName.equals(JSplitPane.LAST_DIVIDER_LOCATION_PROPERTY)) {
                    if (getSimilarSnippets() != null) {
                        setNavigator();
                    }
                }
            }
        };

        jSplitPaneSourceCode.addPropertyChangeListener(propertyChangeListener);
    }
    return jSplitPaneSourceCode;
}

From source file:com.sec.ose.osi.ui.frm.login.JPanLogin.java

/****************
 *  Proxy Info//  ww w.  ja  v a 2 s .  c  o m
 ***************/

private JPanel getJPanelForProxyInfo() {
    if (jPanelForProxyInfo == null) {
        GridBagConstraints gridBagConstraintsProxyInfo = new GridBagConstraints();
        gridBagConstraintsProxyInfo.fill = GridBagConstraints.HORIZONTAL;
        gridBagConstraintsProxyInfo.gridx = -1;
        gridBagConstraintsProxyInfo.gridy = -1;
        gridBagConstraintsProxyInfo.gridwidth = 1;
        gridBagConstraintsProxyInfo.anchor = GridBagConstraints.CENTER;
        gridBagConstraintsProxyInfo.weightx = 1.0;
        gridBagConstraintsProxyInfo.weighty = 0.0;
        //gridBagConstraints5.insets = new Insets(10, 10, 0, 20);
        jPanelForProxyInfo = new JPanel();
        jPanelForProxyInfo.setLayout(new GridBagLayout());
        jPanelForProxyInfo.setBorder(BorderFactory.createTitledBorder(null, "Proxy Setting",
                TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION,
                new Font("Dialog", Font.BOLD, 12), new Color(51, 51, 51)));
        jPanelForProxyInfo.add(getJPanelProxyInfo(), gridBagConstraintsProxyInfo);
    }
    return jPanelForProxyInfo;
}

From source file:com.sec.ose.osi.ui.dialog.setting.JPanProjectAnalysisSetting.java

/**
 * This method initializes jInnerPanel   
 *    /*from   w ww  .  j  a v  a  2  s  .  c  o m*/
 * @return javax.swing.JPanel   
 */
private JPanel getJPanelMonitorInterval() {
    if (jInnerPanel == null) {
        GridBagConstraints gridBagConstraints12 = new GridBagConstraints();
        gridBagConstraints12.anchor = GridBagConstraints.WEST;
        gridBagConstraints12.gridx = 0;
        gridBagConstraints12.gridy = 1;
        gridBagConstraints12.weightx = 1.0;
        gridBagConstraints12.insets = new Insets(0, 0, 10, 0);
        gridBagConstraints12.fill = GridBagConstraints.NONE;
        GridBagConstraints gridBagConstraints8 = new GridBagConstraints();
        gridBagConstraints8.anchor = GridBagConstraints.WEST;
        gridBagConstraints8.insets = new Insets(0, 0, 0, 0);
        gridBagConstraints8.gridx = -1;
        gridBagConstraints8.gridy = -1;
        gridBagConstraints8.weightx = 1.0;
        gridBagConstraints8.fill = GridBagConstraints.NONE;
        jInnerPanel = new JPanel();
        jInnerPanel.setLayout(new GridBagLayout());
        jInnerPanel.setBorder(BorderFactory.createTitledBorder(null, "Monitor Interval",
                TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION,
                new Font("Dialog", Font.BOLD, 12), new Color(51, 51, 51)));
        jInnerPanel.add(getJIntRadioTopPanel(), gridBagConstraints8);
        jInnerPanel.add(getJIntRadioBottomPanel(), gridBagConstraints12);
    }
    return jInnerPanel;
}

From source file:com.sec.ose.osi.ui.frm.main.manage.JPanManageMain.java

/**
 * This method initializes jPanelConsol   
 *    /* www .  ja va  2s . com*/
 * @return javax.swing.JPanel   
 */
private JPanel getJPanelConsol() {
    if (jPanelConsol == null) {
        GridBagConstraints gridBagConstraintsForConsole = new GridBagConstraints();
        gridBagConstraintsForConsole.fill = GridBagConstraints.BOTH;
        gridBagConstraintsForConsole.weightx = 1.0;
        gridBagConstraintsForConsole.weighty = 1.0;
        gridBagConstraintsForConsole.gridwidth = 3;
        gridBagConstraintsForConsole.insets = new Insets(10, 10, 10, 10);

        GridBagConstraints gridBagConstraintsForProgressBar = new GridBagConstraints();
        gridBagConstraintsForProgressBar.fill = GridBagConstraints.BOTH;
        gridBagConstraintsForProgressBar.gridx = 0;
        gridBagConstraintsForProgressBar.gridy = 1;
        gridBagConstraintsForProgressBar.weightx = 1.0;
        gridBagConstraintsForProgressBar.gridwidth = 3;
        gridBagConstraintsForProgressBar.insets = new Insets(10, 10, 10, 10);

        GridBagConstraints gridBagConstraintsForLabelStatus = new GridBagConstraints();
        gridBagConstraintsForLabelStatus.fill = GridBagConstraints.BOTH;
        gridBagConstraintsForLabelStatus.gridx = 0;
        gridBagConstraintsForLabelStatus.gridy = 2;
        gridBagConstraintsForLabelStatus.weightx = 0.1;
        gridBagConstraintsForLabelStatus.insets = new Insets(0, 10, 10, 0);

        GridBagConstraints gridBagConstraintsForMonitoringInterfal = new GridBagConstraints();
        gridBagConstraintsForMonitoringInterfal.fill = GridBagConstraints.BOTH;
        gridBagConstraintsForMonitoringInterfal.gridx = 2;
        gridBagConstraintsForMonitoringInterfal.gridy = 2;
        gridBagConstraintsForMonitoringInterfal.weightx = 0.1;
        gridBagConstraintsForMonitoringInterfal.insets = new Insets(0, 0, 10, 10);

        jPanelConsol = new JPanel();
        jPanelConsol.setLayout(new GridBagLayout());
        jPanelConsol.setBorder(BorderFactory.createTitledBorder(null, "Console",
                TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION,
                new Font("Dialog", Font.BOLD, 12), new Color(51, 51, 51)));
        jPanelConsol.add(getJScrollPaneConsole(), gridBagConstraintsForConsole);
        jPanelConsol.add(getJLabelStatus(), gridBagConstraintsForLabelStatus);
        jPanelConsol.add(getJAnalyzeProgressBar(), gridBagConstraintsForProgressBar);
        jPanelConsol.add(getJLabelMonitoringInterval(), gridBagConstraintsForMonitoringInterfal);
    }
    return jPanelConsol;
}

From source file:com.sec.ose.osi.ui.frm.main.report.JPanExportReport.java

private JPanel getJPanelForCreatorInfo() {
    if (jPanelForCreatorInfo == null) {
        GridBagConstraints gridBagConstraints5 = new GridBagConstraints();
        gridBagConstraints5.fill = GridBagConstraints.HORIZONTAL;
        gridBagConstraints5.gridx = -1;// w  w w.  ja v a 2  s . com
        gridBagConstraints5.gridy = -1;
        gridBagConstraints5.gridwidth = 1;
        gridBagConstraints5.anchor = GridBagConstraints.CENTER;
        gridBagConstraints5.weightx = 1.0;
        gridBagConstraints5.weighty = 0.0;
        gridBagConstraints5.insets = new Insets(0, 10, 10, 43); // margin // top, left, bottom, right
        jPanelForCreatorInfo = new JPanel();
        jPanelForCreatorInfo.setLayout(new GridBagLayout());
        jPanelForCreatorInfo.setBorder(BorderFactory.createTitledBorder(null, "Creator Info",
                TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION,
                new Font("Dialog", Font.BOLD, 12), new Color(51, 51, 51)));
        jPanelForCreatorInfo.add(getJPanelCreatorInfo(), gridBagConstraints5);
    }
    return jPanelForCreatorInfo;
}

From source file:net.sf.jabref.gui.groups.GroupSelector.java

private void setEditMode(boolean editMode) {
    Globals.prefs.putBoolean(JabRefPreferences.EDIT_GROUP_MEMBERSHIP_MODE, editModeIndicator);
    editModeIndicator = editMode;//from   ww  w  .ja v a2  s .  c o m

    if (editMode) {
        groupsTree.setBorder(
                BorderFactory.createTitledBorder(BorderFactory.createMatteBorder(2, 2, 2, 2, Color.RED),
                        "Edit mode", TitledBorder.RIGHT, TitledBorder.TOP, Font.getFont("Default"), Color.RED));
        this.setTitle("<html><font color='red'>Groups Edit mode</font></html>");
    } else {
        groupsTree.setBorder(BorderFactory.createEmptyBorder(5, 10, 0, 0));
        this.setTitle(Localization.lang("Groups"));
    }
    groupsTree.revalidate();
    groupsTree.repaint();
}

From source file:com.sec.ose.osi.ui.dialog.setting.JPanProjectAnalysisSetting.java

/**
 * This method initializes jPanel1   //from   w w  w .  j  av a  2s . co m
 *    
 * @return javax.swing.JPanel   
 */
private JPanel getJPanelProjectSplit() {
    if (jPanelProjectSplit == null) {
        jPanelProjectSplit = new JPanel();
        jPanelProjectSplit.setLayout(new GridBagLayout());
        jPanelProjectSplit.setBorder(BorderFactory.createTitledBorder(null, "Project Split",
                TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION,
                new Font("Dialog", Font.BOLD, 12), new Color(51, 51, 51)));

        GridBagConstraints gridBagConstraintsLabelFileCountLimit = new GridBagConstraints();
        gridBagConstraintsLabelFileCountLimit.gridx = 0;
        gridBagConstraintsLabelFileCountLimit.ipadx = 0;
        gridBagConstraintsLabelFileCountLimit.insets = new Insets(0, 5, 0, 0);
        gridBagConstraintsLabelFileCountLimit.gridwidth = 2;
        gridBagConstraintsLabelFileCountLimit.gridy = 1;
        jLabelPojectSplitFileCountLimit = new JLabel();
        jLabelPojectSplitFileCountLimit.setText("Max Number of Files for a project :");
        GridBagConstraints gridBagConstraintsTextFieldSplit = new GridBagConstraints();
        gridBagConstraintsTextFieldSplit.fill = GridBagConstraints.VERTICAL;
        gridBagConstraintsTextFieldSplit.gridy = 1;
        gridBagConstraintsTextFieldSplit.weightx = 0.0;
        gridBagConstraintsTextFieldSplit.insets = new Insets(0, 5, 0, 0);
        gridBagConstraintsTextFieldSplit.anchor = GridBagConstraints.WEST;
        gridBagConstraintsTextFieldSplit.gridx = 2;
        GridBagConstraints gridBagConstraintsLabelSplitRange = new GridBagConstraints();
        gridBagConstraintsLabelSplitRange.gridx = 3;
        gridBagConstraintsLabelSplitRange.insets = new Insets(0, 5, 0, 0);
        gridBagConstraintsLabelSplitRange.weightx = 1.0;
        gridBagConstraintsLabelSplitRange.anchor = GridBagConstraints.WEST;
        gridBagConstraintsLabelSplitRange.gridy = 1;
        jLabel = new JLabel();
        jLabel.setText("( " + Property.getInstance().getMinNumOfFilesUpperLimit() + " ~ "
                + Property.getInstance().getMaxNumOfFilesUpperLimit() + " )");
        jPanelProjectSplit.add(jLabelPojectSplitFileCountLimit, gridBagConstraintsLabelFileCountLimit);

        jPanelProjectSplit.add(getJTextFieldProjectSplitFileCountLimit(), gridBagConstraintsTextFieldSplit);
        jPanelProjectSplit.add(jLabel, gridBagConstraintsLabelSplitRange);
    }
    return jPanelProjectSplit;
}

From source file:SuitaDetails.java

public ParamPanel() {
    setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(new Color(153, 153, 153)),
            "Parameters", TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null,
            new Color(0, 0, 0)));
    setBackground(Color.WHITE);// w ww. j a v a 2s  .com
    jPanel2 = new JPanel();
    jPanel2.setBackground(Color.WHITE);
    JScrollPane jScrollPane3 = new JScrollPane(jPanel2);
    jScrollPane3.setBackground(Color.WHITE);
    jScrollPane3.setBorder(null);
    jPanel2.setLayout(new BoxLayout(jPanel2, BoxLayout.Y_AXIS));

    addpanel = new JPanel();
    addpanel.setMaximumSize(new Dimension(32767, 25));
    addpanel.setMinimumSize(new Dimension(0, 25));
    addpanel.setPreferredSize(new Dimension(50, 25));
    addpanel.setLayout(new BorderLayout());
    JButton add = new JButton("Add");
    add.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent ev) {
            ArrayList<Integer> indexpos3 = (ArrayList<Integer>) parent.getPos().clone();
            indexpos3.add(new Integer(parent.getSubItemsNr()));
            Item property = new Item("param", 0, -1, -1, 10, 20, indexpos3);
            property.setSubItemVisible(false);
            property.setValue("");
            parent.addSubItem(property);
            Param prop = new Param(parent, property);
            jPanel2.remove(addpanel);
            jPanel2.add(prop);
            jPanel2.add(addpanel);
            jPanel2.revalidate();
            jPanel2.repaint();
        }
    });
    addpanel.add(add, BorderLayout.EAST);
    addpanel.setBackground(Color.WHITE);
    GroupLayout paramLayout = new GroupLayout(this);
    this.setLayout(paramLayout);
    paramLayout.setHorizontalGroup(
            paramLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(jScrollPane3));
    paramLayout.setVerticalGroup(
            paramLayout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(jScrollPane3));
}