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) 

Source Link

Document

Adds a title to an existing border, with default positioning (determined by the current look and feel), default justification (leading) and the default font and text color (determined by the current look and feel).

Usage

From source file:net.minelord.gui.panes.IRCPane.java

public void connect() {
    text.setText("");
    status = "Connecting...";
    TitledBorder title = BorderFactory
            .createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), status);
    title.setTitleJustification(TitledBorder.RIGHT);
    scroller.setBorder(title);/*  www. j  a va  2s  . c o  m*/
    if (topic != null && topic.getParent() == this) {
        showTopic(false);
        remove(topic);
    }
    if (userScroller != null && userScroller.getParent() == this) {
        showUserList(false);
        remove(userScroller);
    }
}

From source file:edu.wpi.cs.wpisuitetng.modules.requirementsmanager.view.charts.StatView.java

/**
 * Builds the side panel with all the options for this StatViw
 * //  w w  w  .  ja  v  a 2 s .co  m
 * @return the formatted side panel
 */
public JPanel buildSidePanel() {
    final int VERTICAL_PADDING = 5;
    final int HORIZONTAL_PADDING = 5;
    final int FAR = 5;

    final SpringLayout sidePanelLayout = new SpringLayout();
    final JPanel sidePanel = new JPanel(sidePanelLayout);

    final JLabel lblStatisticType = new JLabel("Statistic Type");

    final String[] availableStatisticTypes = { "Status", "Assignees", "Iterations", "Velocity" };
    // TODO: Add Estimates, Effort, Tasks charts for future use.
    comboBoxStatisticType = new JComboBox(availableStatisticTypes);
    comboBoxStatisticType.addActionListener(this);

    makePieRadio = new JRadioButton("Pie Chart");
    makePieRadio.setMnemonic(KeyEvent.VK_P);
    makePieRadio.setActionCommand("Pie Chart");
    makePieRadio.addActionListener(this);

    makeBarRadio = new JRadioButton("Bar Chart");
    makeBarRadio.setMnemonic(KeyEvent.VK_B);
    makeBarRadio.setActionCommand("Bar Chart");
    makeBarRadio.addActionListener(this);

    makeLineRadio = new JRadioButton("Line Chart");
    makeLineRadio.setMnemonic(KeyEvent.VK_B);
    makeLineRadio.setActionCommand("Line Chart");
    makeLineRadio.addActionListener(this);
    makeLineRadio.setEnabled(false);

    final ButtonGroup group = new ButtonGroup();
    group.add(makePieRadio);
    group.add(makeBarRadio);
    group.add(makeLineRadio);
    updateSelectedItems();

    final JPanel radioPanel = new JPanel(new GridLayout(3, 1));
    radioPanel.add(makePieRadio);
    radioPanel.add(makeBarRadio);
    radioPanel.add(makeLineRadio);
    radioPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Chart Type"));

    sidePanel.add(lblStatisticType);
    sidePanel.add(comboBoxStatisticType);
    sidePanel.add(radioPanel);

    sidePanelLayout.putConstraint(SpringLayout.NORTH, lblStatisticType, VERTICAL_PADDING, SpringLayout.NORTH,
            sidePanel);
    sidePanelLayout.putConstraint(SpringLayout.WEST, lblStatisticType, HORIZONTAL_PADDING, SpringLayout.WEST,
            sidePanel);

    sidePanelLayout.putConstraint(SpringLayout.NORTH, comboBoxStatisticType, VERTICAL_PADDING,
            SpringLayout.SOUTH, lblStatisticType);
    sidePanelLayout.putConstraint(SpringLayout.WEST, comboBoxStatisticType, HORIZONTAL_PADDING,
            SpringLayout.WEST, sidePanel);

    sidePanelLayout.putConstraint(SpringLayout.NORTH, radioPanel, VERTICAL_PADDING + FAR, SpringLayout.SOUTH,
            comboBoxStatisticType);
    sidePanelLayout.putConstraint(SpringLayout.WEST, radioPanel, HORIZONTAL_PADDING, SpringLayout.WEST,
            sidePanel);

    return sidePanel;
}

From source file:org.apache.jmeter.protocol.http.config.gui.HttpDefaultsGui.java

protected JPanel createEmbeddedRsrcPanel() {
    // retrieve Embedded resources
    retrieveEmbeddedResources = new JCheckBox(JMeterUtils.getResString("web_testing_retrieve_images")); // $NON-NLS-1$
    // add a listener to activate or not concurrent dwn.
    retrieveEmbeddedResources.addItemListener(new ItemListener() {
        @Override//from   w w w . java  2 s.  c o m
        public void itemStateChanged(final ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                enableConcurrentDwn(true);
            } else {
                enableConcurrentDwn(false);
            }
        }
    });
    // Download concurrent resources
    concurrentDwn = new JCheckBox(JMeterUtils.getResString("web_testing_concurrent_download")); // $NON-NLS-1$
    concurrentDwn.addItemListener(new ItemListener() {
        @Override
        public void itemStateChanged(final ItemEvent e) {
            if (retrieveEmbeddedResources.isSelected() && e.getStateChange() == ItemEvent.SELECTED) {
                concurrentPool.setEnabled(true);
            } else {
                concurrentPool.setEnabled(false);
            }
        }
    });
    concurrentPool = new JTextField(2); // 2 columns size
    concurrentPool.setMinimumSize(new Dimension(10, (int) concurrentPool.getPreferredSize().getHeight()));
    concurrentPool.setMaximumSize(new Dimension(30, (int) concurrentPool.getPreferredSize().getHeight()));

    final JPanel embeddedRsrcPanel = new HorizontalPanel();
    embeddedRsrcPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
            JMeterUtils.getResString("web_testing_retrieve_title"))); // $NON-NLS-1$
    embeddedRsrcPanel.add(retrieveEmbeddedResources);
    embeddedRsrcPanel.add(concurrentDwn);
    embeddedRsrcPanel.add(concurrentPool);

    // Embedded URL match regex
    embeddedRE = new JLabeledTextField(JMeterUtils.getResString("web_testing_embedded_url_pattern"), 20); // $NON-NLS-1$
    embeddedRsrcPanel.add(embeddedRE);

    return embeddedRsrcPanel;
}

From source file:org.gumtree.vis.hist2d.Hist2DChartEditor.java

private JPanel createMaskingPanel(JFreeChart chart) {
    JPanel wrap = new JPanel(new BorderLayout());

    JPanel maskingPanel = new JPanel(new GridLayout(1, 1));
    maskingPanel.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));

    //Horizontal group
    JPanel managePanel = new JPanel(new BorderLayout());
    managePanel.setBorder(//from w  ww . jav  a2 s.  com
            BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Region of Interests"));

    JPanel inner = new JPanel(new LCBLayout(6));
    inner.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
    inner.add(new JLabel("Select Region"));
    roiCombo = new JComboBox(panel.getMasks().toArray());
    //      colourScaleCombo.setMaximumRowCount(7);
    roiCombo.setActionCommand(CHANGE_ROI_COMMAND);
    roiCombo.addActionListener(this);
    roiCombo.setSelectedIndex(-1);
    inner.add(roiCombo);
    inner.add(new JLabel());

    inner.add(new JLabel("or create"));
    JPanel createNewPanel = new JPanel(new GridLayout(1, 2));
    newRectangleButton = new JButton("New Rectangle");
    newRectangleButton.setActionCommand(CREATE_NEW_RECT_REGION_COMMAND);
    newRectangleButton.addActionListener(this);
    newEllipseButton = new JButton("New Ellipse");
    newEllipseButton.setActionCommand(CREATE_NEW_ELLIPSE_REGION_COMMAND);
    newEllipseButton.addActionListener(this);
    createNewPanel.add(newRectangleButton);
    createNewPanel.add(newEllipseButton);
    inner.add(createNewPanel);
    inner.add(new JLabel());

    JPanel editPanel = new JPanel(new BorderLayout());
    editPanel
            .setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Edit the Region"));

    JPanel editInner = new JPanel(new LCBLayout(6));
    editInner.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
    editInner.add(new JLabel("Name"));
    roiName = new JTextField(10);
    //      colourScaleCombo.setMaximumRowCount(7);
    roiName.setActionCommand(CHANGE_ROI_NAME_COMMAND);
    roiName.addActionListener(this);
    editInner.add(roiName);
    editInner.add(new JLabel());

    editInner.add(new JLabel("Usage"));
    ButtonGroup buttonGroup = new ButtonGroup();
    JPanel radioPanel = new JPanel(new GridLayout(1, 2));
    inclusiveRadio = new JRadioButton("inclusive");
    inclusiveRadio.setActionCommand(USE_INCLUSIVE_COMMAND);
    inclusiveRadio.addActionListener(this);
    buttonGroup.add(inclusiveRadio);
    radioPanel.add(inclusiveRadio);
    exclusiveRadio = new JRadioButton("exclusive");
    exclusiveRadio.setActionCommand(USE_EXCLUSIVE_COMMAND);
    exclusiveRadio.addActionListener(this);
    buttonGroup.add(exclusiveRadio);
    radioPanel.add(exclusiveRadio);
    editInner.add(radioPanel);
    editInner.add(new JLabel());

    editInner.add(new JLabel("Shape"));
    //      ButtonGroup shapeGroup = new ButtonGroup();
    //      JPanel shapePanel = new JPanel(new GridLayout(1, 2));
    //      rectangleRadio = new JRadioButton("rectangle");
    //      rectangleRadio.setActionCommand(CHOOSE_RECTANGLE_SHAPE_COMMAND);
    //      rectangleRadio.addActionListener(this);
    //      shapeGroup.add(rectangleRadio);
    //      shapePanel.add(rectangleRadio);
    //      ellipseRadio = new JRadioButton("ellipse");
    //      ellipseRadio.setActionCommand(CHOOSE_ELLIPSE_SHAPE_COMMAND);
    //      ellipseRadio.addActionListener(this);
    //      shapeGroup.add(ellipseRadio);
    //      shapePanel.add(ellipseRadio);
    //      editInner.add(shapePanel);
    shapeLabel = new JLabel();
    editInner.add(shapeLabel);
    editInner.add(new JLabel());

    editInner.add(new JLabel("X Range"));
    JPanel xRangePanel = new JPanel(new GridLayout(1, 2));
    JPanel xMinPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    xMinPanel.add(new JLabel("min: "));
    xMin = new JTextField(10);
    //      xMin.setActionCommand(CHANGE_XMIN_COMMAND);
    //      xMin.addActionListener(this);
    xMin.addKeyListener(this);
    xMinPanel.add(xMin);
    xRangePanel.add(xMinPanel);
    JPanel xMaxPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    xMaxPanel.add(new JLabel("max: "));
    xMax = new JTextField(10);
    //      xMax.setActionCommand(CHANGE_XMAX_COMMAND);
    xMax.addKeyListener(this);
    xMaxPanel.add(xMax);
    xRangePanel.add(xMaxPanel);
    editInner.add(xRangePanel);
    editInner.add(new JLabel());

    editInner.add(new JLabel("Y Range"));
    JPanel yRangePanel = new JPanel(new GridLayout(1, 2));
    JPanel yMinPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    yMinPanel.add(new JLabel("min: "));
    yMin = new JTextField(10);
    //      yMin.setActionCommand(CHANGE_YMIN_COMMAND);
    //      yMin.addActionListener(this);
    yMin.addKeyListener(this);
    yMinPanel.add(yMin);
    yRangePanel.add(yMinPanel);
    JPanel yMaxPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
    yMaxPanel.add(new JLabel("max: "));
    yMax = new JTextField(10);
    //      yMax.setActionCommand(CHANGE_YMAX_COMMAND);
    //      yMax.addActionListener(this);
    yMax.addKeyListener(this);
    yMaxPanel.add(yMax);
    yRangePanel.add(yMaxPanel);
    editInner.add(yRangePanel);
    editInner.add(new JLabel());

    editInner.add(new JLabel());
    JPanel applyPanel = new JPanel(new GridLayout(1, 2));
    deleteButton = new JButton("Remove");
    deleteButton.setEnabled(false);
    deleteButton.setActionCommand(REMOVE_CHANGE_ACTION);
    deleteButton.addActionListener(this);
    applyPanel.add(deleteButton);
    applyPanel.add(new JLabel());
    applyButton = new JButton("Apply");
    applyButton.setEnabled(false);
    applyButton.setActionCommand(APPLY_CHANGE_ACTION);
    applyButton.addActionListener(this);
    applyPanel.add(applyButton);
    editInner.add(applyPanel);
    editInner.add(new JLabel());
    //      inner.add(new JLabel("X Range"));
    //      inner.add(inclusiveRadio);
    //      exclusiveRadio = new JRadioButton("exclusive");
    //      exclusiveRadio.setActionCommand(USE_EXCLUSIVE_COMMAND);
    //      exclusiveRadio.addActionListener(this);
    //      inner.add(exclusiveRadio);
    editPanel.add(editInner, BorderLayout.NORTH);
    managePanel.add(editPanel, BorderLayout.SOUTH);
    managePanel.add(inner, BorderLayout.NORTH);
    maskingPanel.add(managePanel);
    wrap.setName("ROI");

    wrap.add(maskingPanel, BorderLayout.NORTH);
    return wrap;
}

From source file:com.net2plan.gui.utils.onlineSimulationPane.OnlineSimulationPane.java

private JPanel configureSimulationControlPanel() {
    pan_simulationController = new JPanel(new MigLayout("fill, insets 0 0 0 0"));
    pan_simulationController/*from   w w w . jav a  2 s .com*/
            .setBorder(BorderFactory.createTitledBorder(new LineBorder(Color.BLACK), "Simulation controller"));

    simInfo = new JTextArea();
    simInfo.setFont(new JLabel().getFont());
    DefaultCaret caret = (DefaultCaret) simInfo.getCaret();
    caret.setUpdatePolicy(DefaultCaret.NEVER_UPDATE);

    toolbar = new JToolBar();

    btn_run = new JButton("Run");
    btn_run.addActionListener(this);
    btn_run.setToolTipText("Execute the simulation [CTRL + U]");
    btn_step = new JButton("Step");
    btn_step.addActionListener(this);
    btn_step.setToolTipText("Execute the next scheduled event and pause");
    btn_pause = new JButton("Pause/Continue");
    btn_pause.addActionListener(this);
    btn_pause.setToolTipText("Pause the simulation (if active) or continue (if paused)");
    btn_stop = new JButton("Stop");
    btn_stop.addActionListener(this);
    btn_stop.setToolTipText("Stop the simulation (it cannot be resumed later)");
    btn_reset = new JButton("Reset");
    btn_reset.addActionListener(this);
    btn_reset.setToolTipText(
            "After stopping the simulation, resets the design to the initial simulation design");
    chk_refresh = new JCheckBox("Refresh");
    chk_refresh.setSelected(true);

    btn_viewEventList = new JButton("View FEL");
    btn_viewEventList.setToolTipText("View future event list (FEL)");
    btn_viewEventList.addActionListener(this);

    toolbar.setFloatable(false);
    toolbar.setRollover(true);
    toolbar.add(btn_run);
    toolbar.add(btn_step);
    toolbar.add(btn_pause);
    toolbar.add(btn_stop);
    toolbar.add(btn_reset);
    toolbar.addSeparator();
    toolbar.add(chk_refresh);
    toolbar.add(Box.createHorizontalGlue());
    toolbar.add(btn_viewEventList);

    pan_simulationController.add(toolbar, "dock north");
    pan_simulationController.add(new JScrollPane(simInfo), "grow");

    return pan_simulationController;
}

From source file:net.pandoragames.far.ui.swing.dialog.SettingsDialog.java

private void init() {
    this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    this.setLayout(new BoxLayout(this.getContentPane(), BoxLayout.Y_AXIS));
    this.setResizable(false);

    JPanel basePanel = new JPanel();
    basePanel.setLayout(new BoxLayout(basePanel, BoxLayout.Y_AXIS));
    basePanel.setBorder(/*from   w ww  .  j  a  va 2s  .c o m*/
            BorderFactory.createEmptyBorder(0, SwingConfig.PADDING, SwingConfig.PADDING, SwingConfig.PADDING));
    registerCloseWindowKeyListener(basePanel);

    // sink for error messages
    MessageLabel errorField = new MessageLabel();
    errorField.setMinimumSize(new Dimension(100, swingConfig.getStandardComponentHight()));
    errorField.setBorder(BorderFactory.createEmptyBorder(1, SwingConfig.PADDING, 2, SwingConfig.PADDING));
    TwoComponentsPanel lineError = new TwoComponentsPanel(errorField,
            Box.createRigidArea(new Dimension(1, swingConfig.getStandardComponentHight())));
    lineError.setAlignmentX(Component.LEFT_ALIGNMENT);
    basePanel.add(lineError);

    // character set
    JLabel labelCharset = new JLabel(swingConfig.getLocalizer().localize("label.default-characterset"));
    labelCharset.setAlignmentX(Component.LEFT_ALIGNMENT);
    basePanel.add(labelCharset);

    JComboBox listCharset = new JComboBox(swingConfig.getCharsetList().toArray());
    listCharset.setAlignmentX(Component.LEFT_ALIGNMENT);
    listCharset.setSelectedItem(swingConfig.getDefaultCharset());
    listCharset.setEditable(true);
    listCharset.setMaximumSize(
            new Dimension(SwingConfig.COMPONENT_WIDTH_MAX, swingConfig.getStandardComponentHight()));

    listCharset.addActionListener(new CharacterSetListener(errorField));
    listCharset.setEditor(new CharacterSetEditor(errorField));
    basePanel.add(listCharset);

    basePanel.add(Box.createRigidArea(new Dimension(1, SwingConfig.PADDING)));

    // select the group selector
    JPanel selectorPanel = new JPanel();
    selectorPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
    selectorPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
    // linePattern.setAlignmentX( Component.LEFT_ALIGNMENT );
    JLabel labelSelector = new JLabel(swingConfig.getLocalizer().localize("label.group-ref-indicator"));
    selectorPanel.add(labelSelector);
    JComboBox selectorBox = new JComboBox(FARConfig.GROUPREFINDICATORLIST);
    selectorBox.setSelectedItem(Character.toString(groupReference));
    selectorBox.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            JComboBox cbox = (JComboBox) event.getSource();
            String indicator = (String) cbox.getSelectedItem();
            groupReference = indicator.charAt(0);
        }
    });
    selectorPanel.add(selectorBox);
    basePanel.add(selectorPanel);

    basePanel.add(Box.createRigidArea(new Dimension(1, SwingConfig.PADDING)));

    // checkbox DO BACKUP
    JCheckBox doBackupFlag = new JCheckBox(swingConfig.getLocalizer().localize("label.create-backup"));
    doBackupFlag.setAlignmentX(Component.LEFT_ALIGNMENT);
    doBackupFlag.setHorizontalTextPosition(SwingConstants.LEADING);
    doBackupFlag.setSelected(replaceForm.isDoBackup());
    doBackupFlag.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent event) {
            doBackup = ItemEvent.SELECTED == event.getStateChange();
            backupFlagEvent = event;
        }
    });
    basePanel.add(doBackupFlag);

    JTextField backupDirPathTextField = new JTextField();
    backupDirPathTextField.setPreferredSize(
            new Dimension(SwingConfig.COMPONENT_WIDTH, swingConfig.getStandardComponentHight()));
    backupDirPathTextField.setMaximumSize(
            new Dimension(SwingConfig.COMPONENT_WIDTH_MAX, swingConfig.getStandardComponentHight()));
    backupDirPathTextField.setText(backupDirectory.getPath());
    backupDirPathTextField.setToolTipText(backupDirectory.getPath());
    backupDirPathTextField.setEditable(false);
    JButton openBaseDirFileChooserButton = new JButton(swingConfig.getLocalizer().localize("button.browse"));
    BrowseButtonListener backupDirButtonListener = new BrowseButtonListener(backupDirPathTextField,
            new BackUpDirectoryRepository(swingConfig, findForm, replaceForm, errorField),
            swingConfig.getLocalizer().localize("label.choose-backup-directory"));
    openBaseDirFileChooserButton.addActionListener(backupDirButtonListener);
    TwoComponentsPanel lineBaseDir = new TwoComponentsPanel(backupDirPathTextField,
            openBaseDirFileChooserButton);
    lineBaseDir.setAlignmentX(Component.LEFT_ALIGNMENT);
    basePanel.add(lineBaseDir);

    basePanel.add(Box.createRigidArea(new Dimension(1, SwingConfig.PADDING)));

    JPanel fileInfoPanel = new JPanel();
    fileInfoPanel
            .setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED),
                    swingConfig.getLocalizer().localize("label.default-file-info")));
    fileInfoPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
    fileInfoPanel.setLayout(new BoxLayout(fileInfoPanel, BoxLayout.Y_AXIS));
    JLabel fileInfoLabel = new JLabel(swingConfig.getLocalizer().localize("message.displayed-in-info-column"));
    fileInfoLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
    fileInfoPanel.add(fileInfoLabel);
    fileInfoPanel.add(Box.createHorizontalGlue());
    JRadioButton nothingRadio = new JRadioButton(swingConfig.getLocalizer().localize("label.nothing"));
    nothingRadio.setAlignmentX(Component.LEFT_ALIGNMENT);
    nothingRadio.setActionCommand(SwingConfig.DefaultFileInfo.NOTHING.name());
    nothingRadio.setSelected(swingConfig.getDefaultFileInfo() == SwingConfig.DefaultFileInfo.NOTHING);
    fileInfoOptions.add(nothingRadio);
    fileInfoPanel.add(nothingRadio);
    JRadioButton readOnlyRadio = new JRadioButton(
            swingConfig.getLocalizer().localize("label.read-only-warning"));
    readOnlyRadio.setAlignmentX(Component.LEFT_ALIGNMENT);
    readOnlyRadio.setActionCommand(SwingConfig.DefaultFileInfo.READONLY.name());
    readOnlyRadio.setSelected(swingConfig.getDefaultFileInfo() == SwingConfig.DefaultFileInfo.READONLY);
    fileInfoOptions.add(readOnlyRadio);
    fileInfoPanel.add(readOnlyRadio);
    JRadioButton sizeRadio = new JRadioButton(swingConfig.getLocalizer().localize("label.filesize"));
    sizeRadio.setAlignmentX(Component.LEFT_ALIGNMENT);
    sizeRadio.setActionCommand(SwingConfig.DefaultFileInfo.SIZE.name());
    sizeRadio.setSelected(swingConfig.getDefaultFileInfo() == SwingConfig.DefaultFileInfo.SIZE);
    fileInfoOptions.add(sizeRadio);
    fileInfoPanel.add(sizeRadio);
    JCheckBox showPlainBytesFlag = new JCheckBox(
            "  " + swingConfig.getLocalizer().localize("label.show-plain-bytes"));
    showPlainBytesFlag.setAlignmentX(Component.LEFT_ALIGNMENT);
    showPlainBytesFlag.setHorizontalTextPosition(SwingConstants.LEADING);
    showPlainBytesFlag.setSelected(swingConfig.isShowPlainBytes());
    showPlainBytesFlag.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent event) {
            showBytes = ItemEvent.SELECTED == event.getStateChange();
        }
    });
    fileInfoPanel.add(showPlainBytesFlag);
    JRadioButton lastModifiedRadio = new JRadioButton(
            swingConfig.getLocalizer().localize("label.last-modified"));
    lastModifiedRadio.setAlignmentX(Component.LEFT_ALIGNMENT);
    lastModifiedRadio.setActionCommand(SwingConfig.DefaultFileInfo.LAST_MODIFIED.name());
    lastModifiedRadio
            .setSelected(swingConfig.getDefaultFileInfo() == SwingConfig.DefaultFileInfo.LAST_MODIFIED);
    fileInfoOptions.add(lastModifiedRadio);
    fileInfoPanel.add(lastModifiedRadio);
    basePanel.add(fileInfoPanel);

    // buttons
    JPanel buttonPannel = new JPanel();
    buttonPannel.setAlignmentX(Component.LEFT_ALIGNMENT);
    buttonPannel.setLayout(new FlowLayout(FlowLayout.TRAILING));
    // cancel
    JButton cancelButton = new JButton(swingConfig.getLocalizer().localize("button.cancel"));
    cancelButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent event) {
            SettingsDialog.this.dispose();
        }
    });
    buttonPannel.add(cancelButton);
    // save
    JButton saveButton = new JButton(swingConfig.getLocalizer().localize("button.save"));
    saveButton.addActionListener(new SaveButtonListener());
    buttonPannel.add(saveButton);
    this.getRootPane().setDefaultButton(saveButton);

    this.add(basePanel);
    this.add(buttonPannel);
    placeOnScreen(swingConfig.getScreenCenter());
}

From source file:net.minelord.gui.panes.IRCPane.java

public void quit() {
    status = "Disconnected";
    lastNick = null;//from ww w  .j a v  a  2s.  c  o  m
    TitledBorder title = BorderFactory
            .createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), status);
    title.setTitleJustification(TitledBorder.RIGHT);
    if (userScroller != null)
        userScroller.setBorder(title);
    else
        scroller.setBorder(title);
    input.setText("");
    input.setEnabled(false);
    remove(scroller);
    remove(input);
    if (topic != null && topic.getParent() == this)
        remove(topic);
    if (userScroller != null && userScroller.getParent() == this)
        remove(userScroller);
    add(nickSelectPane);
    quit = false;
    repaint();
}

From source file:com.floreantpos.bo.ui.explorer.ModifierExplorer.java

private JPanel buildSearchForm() {
    List<MenuModifierGroup> grpName;
    JPanel panel = new JPanel();
    panel.setLayout(new MigLayout("", "[][]30[][]30[]", "[]20[]")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    JLabel nameLabel = new JLabel(Messages.getString("ModifierExplorer.3")); //$NON-NLS-1$
    JLabel groupLabel = new JLabel(Messages.getString("ModifierExplorer.4")); //$NON-NLS-1$
    final JTextField nameField = new JTextField(15);
    grpName = MenuModifierGroupDAO.getInstance().findAll();
    final JComboBox cbGroup = new JComboBox();
    cbGroup.addItem(Messages.getString("ModifierExplorer.5")); //$NON-NLS-1$
    for (MenuModifierGroup s : grpName) {
        cbGroup.addItem(s);/*w  ww.ja  v  a 2 s.  c  o m*/
    }

    JButton searchBttn = new JButton(Messages.getString("ModifierExplorer.6")); //$NON-NLS-1$
    panel.add(nameLabel, "align label"); //$NON-NLS-1$
    panel.add(nameField);
    panel.add(groupLabel);
    panel.add(cbGroup);
    panel.add(searchBttn);

    TitledBorder title;
    Border loweredetched;
    loweredetched = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
    title = BorderFactory.createTitledBorder(loweredetched, Messages.getString("ModifierExplorer.8")); //$NON-NLS-1$
    title.setTitleJustification(TitledBorder.LEFT);
    panel.setBorder(title);
    searchBttn.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            List<MenuModifier> modifierList;
            String txName = nameField.getText();
            Object selectedItem = cbGroup.getSelectedItem();
            if (selectedItem instanceof MenuModifierGroup) {
                modifierList = ModifierDAO.getInstance().findModifier(txName, (MenuModifierGroup) selectedItem);
            } else {
                modifierList = ModifierDAO.getInstance().findModifier(txName, null);
            }

            setModifierList(modifierList);
        }
    });
    return panel;
}

From source file:com.att.aro.ui.view.menu.tools.RegexWizard.java

private JTextArea createTextAreaAndProperties(String title) {
    JTextArea textArea = new JTextArea();
    textArea.setLineWrap(true);//from  ww  w  .  j  av  a 2 s. c  om
    TitledBorder ttlBorder = BorderFactory.createTitledBorder(BorderFactory.createCompoundBorder(
            BorderFactory.createRaisedBevelBorder(), BorderFactory.createLoweredBevelBorder()), title);
    ttlBorder.setTitleColor(Color.BLUE);
    ttlBorder.setTitleFont(ttlBorder.getTitleFont().deriveFont(Font.BOLD));
    textArea.setBorder(ttlBorder);
    textArea.addFocusListener(this);
    return textArea;
}

From source file:net.minelord.gui.panes.IRCPane.java

public void updateTopic() {
    if (client.getTopic().trim().length() > 0) {
        if (topic == null)
            topic = new JLabel();
        topic.setText(client.getTopic());
        TitledBorder title = BorderFactory.createTitledBorder(
                BorderFactory.createEtchedBorder(EtchedBorder.LOWERED),
                "Topic set by " + client.getTopicSetter());
        title.setTitleJustification(TitledBorder.LEFT);
        topic.setBorder(title);/*from   w w w  .  j av  a 2  s.c o m*/
        // add(topic);

    } else {
        showTopic(false);
    }
    repaint();
}