コード例 #1
0
  private void buildUI() {
    Box.Filler divider =
        new Box.Filler(new Dimension(1, 1), new Dimension(1, 1), new Dimension(1, 1));
    divider.setBackground(field.getForeground());
    divider.setOpaque(true);

    GridBagConstraints gbcLabel =
        new GridBagConstraints(
            1,
            1,
            1,
            1,
            0,
            1,
            GridBagConstraints.CENTER,
            GridBagConstraints.NONE,
            new Insets(0, 0, 0, 0),
            0,
            0);
    GridBagConstraints gbcDivider =
        new GridBagConstraints(
            2,
            1,
            1,
            1,
            0,
            1,
            GridBagConstraints.CENTER,
            GridBagConstraints.VERTICAL,
            new Insets(0, 2, 0, 2),
            0,
            0);
    GridBagConstraints gbcField =
        new GridBagConstraints(
            3,
            1,
            1,
            1,
            1,
            1,
            GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL,
            new Insets(0, 0, 0, 0),
            0,
            0);

    setLayout(new GridBagLayout());
    add(label, gbcLabel);
    add(divider, gbcDivider);
    add(field, gbcField);

    setBorder(field.getBorder());
    setBackground(field.getBackground());
    setOpaque(true);
    label.setBackground(field.getBackground());
    label.setOpaque(true);
    field.setBorder(null);
  }
コード例 #2
0
 /** Sets a textfield where the number of pages will be displayed */
 public void setPageCounterField(JTextField _field, Color _color, JComponent _button) {
   pageCounterField = _field;
   pageCounterFieldDefaultColor = _field.getBackground();
   pageCounterFieldColor = _color;
   this.pageCounterButton = _button;
   this.pageCounterButtonDefaultForeground = _button.getForeground();
 }
コード例 #3
0
  private void enableProxy(boolean enabled) {
    myHostNameLabel.setEnabled(enabled);
    myPortNumberLabel.setEnabled(enabled);
    myProxyHostTextField.setEnabled(enabled);
    myProxyPortTextField.setEnabled(enabled);
    mySocks.setEnabled(enabled);
    myHTTP.setEnabled(enabled);
    myProxyExceptions.setEnabled(enabled);
    myProxyExceptions.setBackground(myProxyPortTextField.getBackground());
    myProxyExceptionsLabel.setEnabled(enabled);
    myNoProxyForLabel.setEnabled(enabled);

    myProxyAuthCheckBox.setEnabled(enabled);
    enableProxyAuthentication(enabled && myProxyAuthCheckBox.isSelected());
    myCheckButton.setEnabled(canEnableConnectionCheck());

    final boolean autoDetectProxy = myAutoDetectProxyRb.isSelected();
    myPacUrlCheckBox.setEnabled(autoDetectProxy);
    myClearPasswordsButton.setEnabled(autoDetectProxy);
    myPacUrlTextField.setEnabled(autoDetectProxy && myPacUrlCheckBox.isSelected());
  }