Example usage for javax.swing BorderFactory createEtchedBorder

List of usage examples for javax.swing BorderFactory createEtchedBorder

Introduction

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

Prototype

public static Border createEtchedBorder(int type) 

Source Link

Document

Creates a border with an "etched" look using the component's current background color for highlighting and shading.

Usage

From source file:de.tud.kom.p2psim.impl.skynet.visualization.MetricsPlot.java

private JPanel createRadioBoxes(boolean enable) {
    JPanel rbPanel = new JPanel(new FlowLayout());
    rbPanel.add(setJRadioButton("Min-Values", enable));
    rbPanel.add(setJRadioButton("Max-Values", enable));
    rbPanel.add(setJRadioButton("Standard-Deviation", enable));
    setSizeOfComponent(rbPanel, new Dimension(plotWidth, boxOffset));
    rbPanel.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
    return rbPanel;
}

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

public void disconnect() {
    status = "Disconnecting...";
    TitledBorder title = BorderFactory
            .createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), status);
    title.setTitleJustification(TitledBorder.RIGHT);
    if (userScroller != null)
        userScroller.setBorder(title);//from ww w  .  j  a v a2s .  c om
    else
        scroller.setBorder(title);
    input.setEnabled(false);
}

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);//w w w .  jav  a2s.  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:com.att.aro.ui.view.menu.datacollector.DeviceDialogOptions.java

public AttnrPanel getAttnrGroup() {
    if (attnrGroupPanel == null) {
        miniAtnr = new AttenuatorModel();
        attnrGroupPanel = new AttnrPanel(parent, miniAtnr);
        Border loweredetched = BorderFactory.createEtchedBorder(EtchedBorder.LOWERED);
        attnrGroupPanel.setBorder(loweredetched);
    }/*from w  ww .  j a va  2s . c o  m*/
    return attnrGroupPanel;
}

From source file:com.jwmsolutions.timeCheck.gui.TodoForm.java

private JPanel getJPanel1() {
    if (jPanel1 == null) {
        jPanel1 = new JPanel();
        FlowLayout jPanel1Layout = new FlowLayout();
        jPanel1Layout.setAlignment(FlowLayout.LEFT);
        jPanel1.setLayout(jPanel1Layout);
        {/*from ww w  .j a  v  a  2 s .c  o  m*/
            jLabel2 = new javax.swing.JLabel();
            jPanel1.add(jLabel2);
            jLabel2.setText("Time:");
        }
        {
            jtfHours = new javax.swing.JTextField();
            jPanel1.add(jtfHours);
            jtfHours.setText("0");
            jtfHours.setPreferredSize(new java.awt.Dimension(25, 21));
            jtfHours.setBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED));
        }
        {
            jLabel3 = new javax.swing.JLabel();
            jPanel1.add(jLabel3);
            jLabel3.setText("hours");
        }
    }
    return jPanel1;
}

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(/*w  w w  . j  a  v a 2s. c  om*/
            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   www. ja  va  2  s . co  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);/*from  ww w .j  av a 2  s.  com*/
    }

    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.jwmsolutions.timeCheck.gui.TodoForm.java

private JTextArea getJtfDescription() {
    if (jtfDescription == null) {
        jtfDescription = new JTextArea();
        jtfDescription.setBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED));
    }/* w w w .  ja  va  2s . com*/
    return jtfDescription;
}

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  a  v a  2 s  .c o m
        // add(topic);

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