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() 

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:org.opendatakit.briefcase.ui.settings.SettingsPanelForm.java

/**
 * Method generated by IntelliJ IDEA GUI Designer
 * >>> IMPORTANT!! <<<
 * DO NOT edit this method OR call it in your code!
 *
 * @noinspection ALL//from   w ww.ja v a2  s. c o m
 */
private void $$$setupUI$$$() {
    createUIComponents();
    container = new JPanel();
    container.setLayout(new GridBagLayout());
    storageLocationContainer = new JPanel();
    storageLocationContainer.setLayout(new GridBagLayout());
    GridBagConstraints gbc;
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 1;
    gbc.gridwidth = 5;
    gbc.weightx = 1.0;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    container.add(storageLocationContainer, gbc);
    storageLocationLabel = new JLabel();
    storageLocationLabel.setText("Storage Location");
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.anchor = GridBagConstraints.WEST;
    storageLocationContainer.add(storageLocationLabel, gbc);
    storageLocationField = new JTextField();
    storageLocationField.setEditable(false);
    gbc = new GridBagConstraints();
    gbc.gridx = 2;
    gbc.gridy = 0;
    gbc.weightx = 1.0;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    storageLocationContainer.add(storageLocationField, gbc);
    storageLocationButtons = new JPanel();
    storageLocationButtons.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
    gbc = new GridBagConstraints();
    gbc.gridx = 3;
    gbc.gridy = 0;
    gbc.fill = GridBagConstraints.BOTH;
    storageLocationContainer.add(storageLocationButtons, gbc);
    storageLocationClearButton = new JButton();
    storageLocationClearButton.setText("Clear");
    storageLocationClearButton.setVisible(false);
    storageLocationButtons.add(storageLocationClearButton);
    storageLocationChooseButton = new JButton();
    storageLocationChooseButton.setText("Choose...");
    storageLocationButtons.add(storageLocationChooseButton);
    final JPanel spacer1 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 0;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    storageLocationContainer.add(spacer1, gbc);
    pullInParallelField = new JCheckBox();
    pullInParallelField.setText("Pull submissions in parallel (experimental)");
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 3;
    gbc.gridwidth = 5;
    gbc.anchor = GridBagConstraints.WEST;
    container.add(pullInParallelField, gbc);
    rememberPasswordsField = new JCheckBox();
    rememberPasswordsField.setText("Remember passwords (unencrypted)");
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 7;
    gbc.gridwidth = 5;
    gbc.anchor = GridBagConstraints.WEST;
    container.add(rememberPasswordsField, gbc);
    sendUsageDataField = new JCheckBox();
    sendUsageDataField.setText("Send usage data and crash logs to core developers");
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 9;
    gbc.gridwidth = 5;
    gbc.anchor = GridBagConstraints.WEST;
    container.add(sendUsageDataField, gbc);
    useHttpProxyField = new JCheckBox();
    useHttpProxyField.setText("Use HTTP Proxy");
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 11;
    gbc.gridwidth = 5;
    gbc.anchor = GridBagConstraints.WEST;
    container.add(useHttpProxyField, gbc);
    final JPanel spacer2 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 12;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    gbc.insets = new Insets(0, 0, 0, 20);
    container.add(spacer2, gbc);
    httpProxyJostLabel = new JLabel();
    httpProxyJostLabel.setText("Host");
    gbc = new GridBagConstraints();
    gbc.gridx = 2;
    gbc.gridy = 12;
    gbc.anchor = GridBagConstraints.WEST;
    container.add(httpProxyJostLabel, gbc);
    httpProxyHostField = new JTextField();
    httpProxyHostField.setPreferredSize(new Dimension(150, 30));
    httpProxyHostField.setText("127.0.0.1");
    gbc = new GridBagConstraints();
    gbc.gridx = 4;
    gbc.gridy = 12;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    container.add(httpProxyHostField, gbc);
    final JPanel spacer3 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 3;
    gbc.gridy = 12;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    container.add(spacer3, gbc);
    httpProxyPortLabel = new JLabel();
    httpProxyPortLabel.setText("Port");
    gbc = new GridBagConstraints();
    gbc.gridx = 2;
    gbc.gridy = 13;
    gbc.anchor = GridBagConstraints.WEST;
    container.add(httpProxyPortLabel, gbc);
    final JPanel spacer4 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 5;
    gbc.gridy = 12;
    gbc.weightx = 1.0;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    container.add(spacer4, gbc);
    httpProxyPortField.setPreferredSize(new Dimension(150, 30));
    gbc = new GridBagConstraints();
    gbc.gridx = 4;
    gbc.gridy = 13;
    gbc.anchor = GridBagConstraints.WEST;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    container.add(httpProxyPortField, gbc);
    final JPanel spacer5 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 10;
    gbc.gridwidth = 5;
    gbc.fill = GridBagConstraints.VERTICAL;
    container.add(spacer5, gbc);
    final JPanel spacer6 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 6;
    gbc.gridy = 1;
    gbc.gridheight = 13;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    container.add(spacer6, gbc);
    final JPanel spacer7 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 1;
    gbc.gridheight = 13;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    container.add(spacer7, gbc);
    final JPanel spacer8 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 0;
    gbc.gridwidth = 5;
    gbc.fill = GridBagConstraints.VERTICAL;
    container.add(spacer8, gbc);
    final JPanel spacer9 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 14;
    gbc.gridwidth = 5;
    gbc.weighty = 1.0;
    gbc.fill = GridBagConstraints.VERTICAL;
    container.add(spacer9, gbc);
    final JPanel spacer10 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 8;
    gbc.gridwidth = 5;
    gbc.fill = GridBagConstraints.VERTICAL;
    container.add(spacer10, gbc);
    final JPanel spacer11 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 4;
    gbc.gridwidth = 5;
    gbc.fill = GridBagConstraints.VERTICAL;
    container.add(spacer11, gbc);
    final JPanel panel1 = new JPanel();
    panel1.setLayout(new GridBagLayout());
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 15;
    gbc.gridwidth = 5;
    gbc.fill = GridBagConstraints.BOTH;
    container.add(panel1, gbc);
    panel1.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Troubleshooting"));
    reloadCacheButton = new JButton();
    reloadCacheButton.setEnabled(false);
    reloadCacheButton.setText("Reload forms from storage location");
    gbc = new GridBagConstraints();
    gbc.gridx = 2;
    gbc.gridy = 8;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    panel1.add(reloadCacheButton, gbc);
    final JPanel spacer12 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 2;
    gbc.gridy = 7;
    gbc.fill = GridBagConstraints.VERTICAL;
    panel1.add(spacer12, gbc);
    final JPanel spacer13 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 2;
    gbc.gridy = 9;
    gbc.fill = GridBagConstraints.VERTICAL;
    panel1.add(spacer13, gbc);
    final JPanel spacer14 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 3;
    gbc.gridy = 8;
    gbc.weightx = 0.5;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    panel1.add(spacer14, gbc);
    final JPanel spacer15 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 8;
    gbc.weightx = 0.5;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    panel1.add(spacer15, gbc);
    final JLabel label1 = new JLabel();
    label1.setText("The form list in Briefcase can get out of date if files are moved manually.");
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 5;
    gbc.gridwidth = 3;
    gbc.anchor = GridBagConstraints.WEST;
    panel1.add(label1, gbc);
    final JLabel label2 = new JLabel();
    label2.setText("This reload is always safe.");
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 6;
    gbc.gridwidth = 3;
    gbc.anchor = GridBagConstraints.WEST;
    panel1.add(label2, gbc);
    final JPanel spacer16 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 5;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    panel1.add(spacer16, gbc);
    final JPanel spacer17 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 2;
    gbc.gridy = 0;
    gbc.fill = GridBagConstraints.VERTICAL;
    panel1.add(spacer17, gbc);
    final JPanel spacer18 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 4;
    gbc.gridy = 5;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    panel1.add(spacer18, gbc);
    final JPanel spacer19 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 2;
    gbc.gridy = 4;
    gbc.fill = GridBagConstraints.VERTICAL;
    panel1.add(spacer19, gbc);
    cleanAllPullResumePointsButton = new JButton();
    cleanAllPullResumePointsButton.setEnabled(false);
    cleanAllPullResumePointsButton.setText("Clear pull history");
    gbc = new GridBagConstraints();
    gbc.gridx = 2;
    gbc.gridy = 3;
    gbc.fill = GridBagConstraints.HORIZONTAL;
    panel1.add(cleanAllPullResumePointsButton, gbc);
    final JLabel label3 = new JLabel();
    label3.setText("Use if you wish to pull every submission, regardless of last submission pulled.");
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 1;
    gbc.gridwidth = 3;
    gbc.anchor = GridBagConstraints.WEST;
    panel1.add(label3, gbc);
    final JPanel spacer20 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 2;
    gbc.gridy = 2;
    gbc.fill = GridBagConstraints.VERTICAL;
    panel1.add(spacer20, gbc);
    final JPanel spacer21 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 0;
    gbc.gridy = 16;
    gbc.gridwidth = 6;
    gbc.fill = GridBagConstraints.VERTICAL;
    container.add(spacer21, gbc);
    resumeLastPullField = new JCheckBox();
    resumeLastPullField.setText("Start pull from last submission pulled");
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 5;
    gbc.gridwidth = 5;
    gbc.anchor = GridBagConstraints.WEST;
    container.add(resumeLastPullField, gbc);
    final JPanel spacer22 = new JPanel();
    gbc = new GridBagConstraints();
    gbc.gridx = 1;
    gbc.gridy = 6;
    gbc.gridwidth = 5;
    gbc.fill = GridBagConstraints.VERTICAL;
    container.add(spacer22, gbc);
}

From source file:org.gumtree.vis.plot1d.Plot1DChartEditor.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  w  w. ja  va2  s . c  om*/
            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.setSelectedIndex(-1);
    roiCombo.setActionCommand(CHANGE_ROI_COMMAND);
    roiCombo.addActionListener(this);
    inner.add(roiCombo);
    inner.add(new JLabel());

    inner.add(new JLabel("or create"));
    newRectangleButton = new JButton("New Region of Interests");
    newRectangleButton.setActionCommand(CREATE_NEW_RECT_REGION_COMMAND);
    newRectangleButton.addActionListener(this);
    inner.add(newRectangleButton);
    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("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());
    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:org.apache.jmeter.visualizers.CreateReport.java

protected Container makeTitlePanel() {
    VerticalPanel titlePanel = new VerticalPanel();
    titlePanel.add(createTitleLabel());// ww w .ja v  a2s .c o  m
    VerticalPanel contentPanel = new VerticalPanel();
    contentPanel.setBorder(BorderFactory.createEtchedBorder());
    contentPanel.add(getNamePanel());
    contentPanel.add(commentPanel);
    titlePanel.add(contentPanel);
    return titlePanel;
}

From source file:com.unionpay.upmp.jmeterplugin.gui.UPMPUrlConfigGui.java

/**
 * Create a panel containing the proxy server details
 *
 * @return the panel/*w w w  .  ja va2s  . com*/
 */
protected final JPanel getProxyServerPanel() {
    JPanel proxyServer = new HorizontalPanel();
    proxyServer.add(getProxyHostPanel(), BorderLayout.CENTER);
    proxyServer.add(getProxyPortPanel(), BorderLayout.EAST);

    JPanel proxyLogin = new HorizontalPanel();
    proxyLogin.add(getProxyUserPanel());
    proxyLogin.add(getProxyPassPanel());

    JPanel proxyServerPanel = new HorizontalPanel();
    proxyServerPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(),
            UPMPConstant.upmp_proxy_server_title)); // $NON-NLS-1$
    proxyServerPanel.add(proxyServer, BorderLayout.CENTER);
    proxyServerPanel.add(proxyLogin, BorderLayout.EAST);

    return proxyServerPanel;
}

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

private JPanel createCordinatePanel() {
    JPanel wrap = new JPanel(new BorderLayout());

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

    //Horizontal group
    JPanel horizontal = new JPanel(new BorderLayout());
    horizontal/* w w w. j a va 2s  .  c o m*/
            .setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Horizontal Axis"));

    JPanel inner = new JPanel(new LCBLayout(6));
    inner.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));

    inner.add(new JLabel("Flip X Axis"));
    flipX = new JCheckBox();
    flipX.setActionCommand(FLIP_X_AXIS_COMMAND);
    flipX.addActionListener(this);
    inner.add(flipX);
    inner.add(new JLabel());

    horizontal.add(inner, BorderLayout.NORTH);

    //Vertical group
    JPanel vertical = new JPanel(new BorderLayout());
    vertical.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Vertical Axis"));

    inner = new JPanel(new LCBLayout(6));
    inner.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));

    inner.add(new JLabel("Flip Y Axis"));
    flipY = new JCheckBox();
    flipY.setActionCommand(FLIP_Y_AXIS_COMMAND);
    flipY.addActionListener(this);
    inner.add(flipY);
    inner.add(new JLabel());

    vertical.add(inner, BorderLayout.NORTH);

    //Color scale group
    JPanel colorScale = new JPanel(new BorderLayout());
    colorScale.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Color Scale"));

    inner = new JPanel(new LCBLayout(6));
    inner.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));

    inner.add(new JLabel("Show Color Scale"));
    showColorScale = new JCheckBox();
    showColorScale.setActionCommand(SHOW_SCALE_COMMAND);
    showColorScale.addActionListener(this);
    inner.add(showColorScale);
    inner.add(new JLabel());

    inner.add(new JLabel("Select Theme"));
    ColorScale[] scales = ColorScale.values();
    colourScaleCombo = new JComboBox(scales);
    //      colourScaleCombo.setMaximumRowCount(7);
    colourScaleCombo.setActionCommand(CHANGE_COLOUR_SCALE_COMMAND);
    colourScaleCombo.addActionListener(this);
    inner.add(colourScaleCombo);
    inner.add(new JLabel());

    inner.add(new JLabel("Use Logarithmic Scale"));
    logarithmScale = new JCheckBox();
    logarithmScale.setActionCommand(LOGARITHM_SCALE_COMMAND);
    logarithmScale.addActionListener(this);
    inner.add(logarithmScale);
    inner.add(new JLabel());

    colorScale.add(inner, BorderLayout.NORTH);

    coordinate.add(horizontal);
    coordinate.add(vertical);
    coordinate.add(colorScale);
    wrap.setName("Coordinate");

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

From source file:com.web.vehiclerouting.optaplanner.common.swingui.SolverAndPersistenceFrame.java

private JPanel createScorePanel() {
    JPanel scorePanel = new JPanel(new BorderLayout());
    scorePanel.setBorder(BorderFactory.createEtchedBorder());
    showConstraintMatchesDialogAction = new ShowConstraintMatchesDialogAction();
    showConstraintMatchesDialogAction.setEnabled(false);
    scorePanel.add(new JButton(showConstraintMatchesDialogAction), BorderLayout.WEST);
    resultLabel = new JLabel("Score:");
    resultLabel.setBorder(BorderFactory.createLoweredBevelBorder());
    scorePanel.add(resultLabel, BorderLayout.CENTER);
    refreshScreenDuringSolvingCheckBox = new JCheckBox("Refresh screen during solving",
            solutionPanel.isRefreshScreenDuringSolving());
    scorePanel.add(refreshScreenDuringSolvingCheckBox, BorderLayout.EAST);
    return scorePanel;
}

From source file:at.becast.youploader.gui.FrmMain.java

public void initMainTab() {
    cmbCategory = new JComboBox<Categories>();
    cmbCategory.setModel(new DefaultComboBoxModel<Categories>(Categories.values()));
    SideBar sideBar = new SideBar(SideBar.SideBarMode.TOP_LEVEL, true, 300, true);
    ss1 = new SidebarSection(sideBar, LANG.getString("frmMain.Sidebar.Settings"), new EditPanel(this),
            new ImageIcon(getClass().getResource("/pencil.png")));
    ss2 = new SidebarSection(sideBar, LANG.getString("frmMain.Sidebar.Playlists"), new PlaylistPanel(this),
            new ImageIcon(getClass().getResource("/layers.png")));
    ss3 = new SidebarSection(sideBar, LANG.getString("frmMain.Sidebar.Monetisation"), new MonetPanel(),
            new ImageIcon(getClass().getResource("/money.png")));
    sideBar.addSection(ss1, false);//from ww  w  .  j a va  2s .  co  m
    sideBar.addSection(ss2);
    sideBar.addSection(ss3);
    JPanel mainTab = new JPanel();
    JPanel panel = new JPanel();
    GroupLayout mainTabLayout = new GroupLayout(mainTab);
    mainTabLayout.setHorizontalGroup(mainTabLayout.createParallelGroup(Alignment.TRAILING)
            .addGroup(mainTabLayout.createSequentialGroup()
                    .addComponent(panel, GroupLayout.DEFAULT_SIZE, 465, Short.MAX_VALUE)
                    .addPreferredGap(ComponentPlacement.RELATED)
                    .addComponent(sideBar, GroupLayout.DEFAULT_SIZE, 408, Short.MAX_VALUE)));
    mainTabLayout.setVerticalGroup(mainTabLayout.createParallelGroup(Alignment.LEADING)
            .addComponent(panel, GroupLayout.DEFAULT_SIZE, 492, Short.MAX_VALUE)
            .addGroup(mainTabLayout.createSequentialGroup()
                    .addComponent(sideBar, GroupLayout.DEFAULT_SIZE, 469, Short.MAX_VALUE).addContainerGap()));
    panel.setLayout(new FormLayout(
            new ColumnSpec[] { ColumnSpec.decode("2px"), FormSpecs.RELATED_GAP_COLSPEC,
                    ColumnSpec.decode("20px:grow"), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC,
                    ColumnSpec.decode("23px"), ColumnSpec.decode("33px"), FormSpecs.UNRELATED_GAP_COLSPEC,
                    ColumnSpec.decode("61px"), FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC,
                    ColumnSpec.decode("24px"), ColumnSpec.decode("28px"), ColumnSpec.decode("40px"),
                    ColumnSpec.decode("36px"), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("28px"),
                    FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("58px"), },
            new RowSpec[] { RowSpec.decode("2px"), FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("14px"),
                    RowSpec.decode("25px"), FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("14px"),
                    RowSpec.decode("25px"), FormSpecs.LINE_GAP_ROWSPEC, RowSpec.decode("14px"),
                    RowSpec.decode("25px"), FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
                    RowSpec.decode("64dlu:grow"), FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
                    RowSpec.decode("max(64dlu;default)"), FormSpecs.RELATED_GAP_ROWSPEC,
                    FormSpecs.DEFAULT_ROWSPEC, RowSpec.decode("25px"), FormSpecs.PARAGRAPH_GAP_ROWSPEC,
                    RowSpec.decode("24px"), RowSpec.decode("23px"), }));

    lbltitlelenght = new JLabel("(0/100)");
    panel.add(lbltitlelenght, "14, 6, 3, 1, right, top");

    txtTitle = new JTextField();
    contextMenu.add(txtTitle);
    panel.add(txtTitle, "3, 7, 14, 1, fill, fill");
    txtTitle.setColumns(10);
    txtTitle.addKeyListener(new KeyAdapter() {
        @Override
        public void keyReleased(KeyEvent e) {
            calcNotifies();
        }
    });

    JLabel lblCategory = new JLabel(LANG.getString("frmMain.Category"));
    panel.add(lblCategory, "3, 9, 4, 1, left, bottom");
    panel.add(cmbCategory, "3, 10, 14, 1, fill, fill");

    JLabel lblDescription = new JLabel(LANG.getString("frmMain.Description"));
    panel.add(lblDescription, "3, 12, 4, 1, left, bottom");

    lblDesclenght = new JLabel("(0/5000)");
    panel.add(lblDesclenght, "14, 12, 3, 1, right, bottom");

    JScrollPane DescriptionScrollPane = new JScrollPane();
    panel.add(DescriptionScrollPane, "3, 13, 14, 1, fill, fill");

    txtDescription = new JTextArea();
    contextMenu.add(txtDescription);
    txtDescription.setFont(new Font("SansSerif", Font.PLAIN, 13));
    DescriptionScrollPane.setViewportView(txtDescription);
    txtDescription.setWrapStyleWord(true);
    txtDescription.setLineWrap(true);
    txtDescription.addKeyListener(new KeyAdapter() {
        @Override
        public void keyReleased(KeyEvent e) {
            calcNotifies();
        }
    });

    JLabel lblTags = new JLabel(LANG.getString("frmMain.Tags"));
    panel.add(lblTags, "3, 15, 4, 1, left, bottom");

    lblTagslenght = new JLabel("(0/500)");
    panel.add(lblTagslenght, "14, 15, 3, 1, right, top");

    JScrollPane TagScrollPane = new JScrollPane();
    panel.add(TagScrollPane, "3, 16, 14, 1, fill, fill");

    txtTags = new JTextArea();
    contextMenu.add(txtTags);
    txtTags.setFont(new Font("SansSerif", Font.PLAIN, 13));
    TagScrollPane.setViewportView(txtTags);
    txtTags.setWrapStyleWord(true);
    txtTags.setLineWrap(true);
    txtTags.setBorder(BorderFactory.createEtchedBorder());
    txtTags.addKeyListener(new KeyAdapter() {
        @Override
        public void keyReleased(KeyEvent e) {
            calcNotifies();
        }
    });

    JLabel lblAccount = new JLabel(LANG.getString("frmMain.Account"));
    panel.add(lblAccount, "3, 18, 4, 1, left, bottom");
    cmbAccount = new JComboBox<AccountType>();
    panel.add(getCmbAccount(), "3, 19, 14, 1, fill, fill");
    cmbAccount.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            changeUser();
        }
    });
    btnAddToQueue = new JButton(LANG.getString("frmMain.addtoQueue"));
    btnAddToQueue.setEnabled(false);
    panel.add(btnAddToQueue, "3, 21, 6, 1, fill, fill");
    btnAddToQueue.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            queueButton();
        }
    });
    JLabel lblSelectVideo = new JLabel();
    panel.add(lblSelectVideo, "3, 3, 4, 1, left, bottom");

    lblSelectVideo.setText(LANG.getString("frmMain.selectVideoFile"));
    cmbFile = new JComboBox<String>();
    cmbFile.setDropTarget(new DropTarget() {
        private static final long serialVersionUID = 8809983794742040683L;

        public synchronized void drop(DropTargetDropEvent evt) {
            try {
                evt.acceptDrop(DnDConstants.ACTION_COPY);
                @SuppressWarnings("unchecked")
                List<File> droppedFiles = (List<File>) evt.getTransferable()
                        .getTransferData(DataFlavor.javaFileListFlavor);
                for (File file : droppedFiles) {
                    cmbFile.removeAllItems();
                    cmbFile.addItem(file.getAbsolutePath());
                }
            } catch (Exception ex) {
                LOG.error("Error dropping video file", ex);
            }
        }
    });
    panel.add(cmbFile, "3, 4, 14, 1, fill, fill");
    JButton btnSelectMovie = new JButton();
    btnSelectMovie.setToolTipText("Select Video File");
    panel.add(btnSelectMovie, "18, 4, center, top");
    btnSelectMovie.setIcon(new ImageIcon(getClass().getResource("/film_add.png")));

    JLabel lblTitle = new JLabel(LANG.getString("frmMain.Title"));
    panel.add(lblTitle, "3, 6, 4, 1, left, bottom");

    JButton btnReset = new JButton(LANG.getString("frmMain.Reset"));
    btnReset.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            resetEdit();
        }
    });
    panel.add(btnReset, "11, 21, 6, 1, fill, fill");
    btnSelectMovie.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            EditPanel edit = (EditPanel) ss1.contentPane;
            NativeJFileChooser chooser;
            if (edit.getTxtStartDir() != null && !edit.getTxtStartDir().equals("")) {
                chooser = new NativeJFileChooser(edit.getTxtStartDir().getText().trim());
            } else {
                chooser = new NativeJFileChooser();
            }
            int returnVal = chooser.showOpenDialog((Component) self);
            if (returnVal == JFileChooser.APPROVE_OPTION) {
                cmbFile.removeAllItems();
                cmbFile.addItem(chooser.getSelectedFile().getAbsolutePath().toString());
            }
        }
    });
    mainTab.setLayout(mainTabLayout);
    mainTab.revalidate();
    mainTab.repaint();
    TabbedPane.addTab(LANG.getString("frmMain.Tabs.VideoSettings"), mainTab);
}

From source file:view.App.java

private void renderChart(SpreadObject obj) {
    try {//w ww.j a va 2s.c  o  m
        jPanel3.removeAll();
        jPanel3.revalidate();
        chart = ChartFactory.createTimeSeriesChart(
                obj.getBaseStock().getTicker() + " : " + obj.getSecondStock().getTicker(), "date",
                "spread ratio", createDataset(obj), true, true, false);
    } catch (ParseException e) {
        System.out.println("    " + e.toString());
    }

    final XYPlot plot = chart.getXYPlot();

    XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
    renderer.setSeriesShape(0, new Ellipse2D.Double(-3, -3, 0, 0));
    renderer.setSeriesPaint(0, Color.RED);
    plot.setRenderer(renderer);

    axis = (DateAxis) plot.getDomainAxis();
    axis.setDateFormatOverride(new SimpleDateFormat("dd-MM-yyyy"));

    ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.setDomainZoomable(true);
    chartPanel.setRangeZoomable(false);
    Border border = BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4),
            BorderFactory.createEtchedBorder());
    chartPanel.setBorder(border);

    jPanel3.add(chartPanel);
    jPanel3.revalidate();
}

From source file:com.employee.scheduler.common.swingui.SolverAndPersistenceFrame.java

private JPanel createScorePanel() {
    JPanel scorePanel = new JPanel(new BorderLayout());
    scorePanel.setBorder(BorderFactory.createEtchedBorder());
    showConstraintMatchesDialogAction = new ShowConstraintMatchesDialogAction();
    showConstraintMatchesDialogAction.setEnabled(false);
    scorePanel.add(new JButton(showConstraintMatchesDialogAction), BorderLayout.WEST);
    scoreField = new JTextField("Score:");
    scoreField.setEditable(false);// w ww.  ja  v a  2s.  com
    scoreField.setForeground(Color.BLACK);
    scoreField.setBorder(BorderFactory.createLoweredBevelBorder());
    scorePanel.add(scoreField, BorderLayout.CENTER);
    refreshScreenDuringSolvingCheckBox = new JCheckBox("Refresh screen during solving",
            solutionPanel.isRefreshScreenDuringSolving());
    scorePanel.add(refreshScreenDuringSolvingCheckBox, BorderLayout.EAST);
    return scorePanel;
}

From source file:org.gumtree.vis.plot1d.Plot1DChartEditor.java

private JPanel createCordinatePanel() {
    JPanel wrap = new JPanel(new BorderLayout());
    JPanel coordinate = new JPanel(new GridLayout(2, 1));
    coordinate.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));

    //Horizontal group
    JPanel horizontal = new JPanel(new BorderLayout());
    horizontal/*from w ww.java  2  s . c o  m*/
            .setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Horizontal Axis"));

    JPanel inner = new JPanel(new LCBLayout(6));
    inner.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));

    inner.add(new JLabel("Logarithm X Axis"));
    logarithmX = new JCheckBox();
    logarithmX.setActionCommand(LOGARITHM_X_AXIS_COMMAND);
    logarithmX.addActionListener(this);
    inner.add(logarithmX);
    inner.add(new JLabel());

    inner.add(new JLabel("Flip X Axis"));
    flipX = new JCheckBox();
    flipX.setActionCommand(FLIP_X_AXIS_COMMAND);
    flipX.addActionListener(this);
    inner.add(flipX);
    inner.add(new JLabel());

    inner.add(new JLabel("X Axis Margin Percentage"));
    horizontalMargin = new JTextField();
    horizontalMargin.setActionCommand(X_AXIS_MARGIN_COMMAND);
    horizontalMargin.addActionListener(this);
    inner.add(horizontalMargin);
    inner.add(new JLabel());

    horizontal.add(inner, BorderLayout.NORTH);

    //Vertical group
    JPanel vertical = new JPanel(new BorderLayout());
    vertical.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Vertical Axis"));

    inner = new JPanel(new LCBLayout(6));
    inner.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));

    inner.add(new JLabel("Logarithm Y Axis"));
    logarithmY = new JCheckBox();
    logarithmY.setActionCommand(LOGARITHM_Y_AXIS_COMMAND);
    logarithmY.addActionListener(this);
    inner.add(logarithmY);
    inner.add(new JLabel());

    inner.add(new JLabel("Flip Y Axis"));
    flipY = new JCheckBox();
    flipY.setActionCommand(FLIP_Y_AXIS_COMMAND);
    flipY.addActionListener(this);
    inner.add(flipY);
    inner.add(new JLabel());

    vertical.add(inner, BorderLayout.NORTH);

    coordinate.add(horizontal, BorderLayout.NORTH);
    coordinate.add(vertical);
    wrap.setName("Coordinate");
    wrap.add(coordinate, BorderLayout.NORTH);
    return wrap;
}