javax.swing.text.JTextComponent.setBorder()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(130)

本文整理了Java中javax.swing.text.JTextComponent.setBorder()方法的一些代码示例,展示了JTextComponent.setBorder()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JTextComponent.setBorder()方法的具体详情如下:
包路径:javax.swing.text.JTextComponent
类名称:JTextComponent
方法名:setBorder

JTextComponent.setBorder介绍

暂无

代码示例

代码示例来源:origin: runelite/runelite

textField.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
textField.setText(configManager.getConfiguration(cd.getGroup().value(), cid.getItem().keyName()));

代码示例来源:origin: io.ultreia.java4all.i18n/i18n-editor

@Override
  public void focusLost(FocusEvent e) {
    editor.setBorder(noFocusBorder);
  }
});

代码示例来源:origin: bobbylight/RSyntaxTextArea

editor.setBorder(new BasicBorders.MarginBorder());

代码示例来源:origin: xyz.cofe/gui.swing

protected JTextComponent getTextField(){
  if( textField!=null )return textField;
  textField = new JTextField();
  textField.setBorder(new EmptyBorder(0,0,0,0));
  return textField;
}
//</editor-fold>

代码示例来源:origin: RPTools/maptool

private JTextComponent getNoteArea() {
  if (noteArea == null) {
    noteArea = new JTextArea();
    noteArea.setBorder(BorderFactory.createLineBorder(Color.black));
  }
  return noteArea;
}

代码示例来源:origin: bcdev/beam

private void setTextComponent(JTextComponent textComponent) {
  _textComponent = textComponent;
  if (_textComponent instanceof JTextArea) {
    _textComponent.setBorder(null);
    _component = new JScrollPane(_textComponent);
    nameComponent(textComponent, "ScrollPane");
  } else {
    _component = _textComponent;
  }
}

代码示例来源:origin: io.ultreia.java4all.i18n/i18n-editor

@Override
public void focusGained(FocusEvent e) {
  editor.setBorder(focusBorder);
  ItemUI parent = (ItemUI) LocalizedItemUI.this.getParent().getParent();
  parent.focus(LocalizedItemUI.this);
}

代码示例来源:origin: atarw/material-ui-swing

@Override
protected void uninstallDefaults() {
  getComponent().setBorder(null);
  super.uninstallDefaults();
}

代码示例来源:origin: com.jtattoo/JTattoo

public void focusLost(FocusEvent e) {
    if (getComponent() != null) {
      if (orgBorder instanceof UIResource) {
        getComponent().setBorder(orgBorder);
      }
      getComponent().invalidate();
      getComponent().repaint();
    }
  }
};

代码示例来源:origin: com.jtattoo/JTattoo

public void focusLost(FocusEvent e) {
    if (getComponent() != null) {
      if (orgBorder instanceof UIResource) {
        getComponent().setBorder(orgBorder);
      }
      getComponent().invalidate();
      getComponent().repaint();
    }
  }
};

代码示例来源:origin: com.jtattoo/JTattoo

public void focusLost(FocusEvent e) {
    if (getComponent() != null) {
      if (orgBorder instanceof UIResource) {
        getComponent().setBorder(orgBorder);
        getComponent().invalidate();
        getComponent().repaint();
      }
    }
  }
};

代码示例来源:origin: com.jtattoo/JTattoo

public void focusLost(FocusEvent e) {
    if (getComponent() != null) {
      if (orgBorder instanceof UIResource) {
        getComponent().setBorder(orgBorder);
      }
      getComponent().invalidate();
      getComponent().repaint();
    }
  }
};

代码示例来源:origin: com.jtattoo/JTattoo

public void focusLost(FocusEvent e) {
    if (getComponent() != null) {
      if (orgBorder instanceof UIResource) {
        getComponent().setBorder(orgBorder);
      }
      getComponent().invalidate();
      getComponent().repaint();
    }
  }
};

代码示例来源:origin: UNIVALI-LITE/Portugol-Studio

public static void configuraWebLaf(JTextComponent field) {
    if (!WeblafUtils.weblafEstaInstalado()) {
      return;
    }
//       ((WebTextAreaUI) field.getUI()).setDrawBorder(false);
//       ((WebTextAreaUI) field.getUI()).setDrawBackground(true);
    field.setBorder(new EmptyBorder(15,15,15,15));
    field.setOpaque(true);
    field.setBackground(ColorController.COR_DESTAQUE);
    field.setForeground(ColorController.COR_LETRA);
  }
  public static void configuraWebLaf(JProgressBar field) {

代码示例来源:origin: com.jtattoo/JTattoo

public void focusGained(FocusEvent e) {
  if (getComponent() != null) {
    orgBorder = getComponent().getBorder();
    LookAndFeel laf = UIManager.getLookAndFeel();
    if (laf instanceof AbstractLookAndFeel && orgBorder instanceof UIResource) {
      Border focusBorder = ((AbstractLookAndFeel)laf).getBorderFactory().getFocusFrameBorder();
      getComponent().setBorder(focusBorder);
    }
    getComponent().invalidate();
    getComponent().repaint();
  }
}

代码示例来源:origin: com.jtattoo/JTattoo

public void focusGained(FocusEvent e) {
  if (getComponent() != null) {
    orgBorder = getComponent().getBorder();
    LookAndFeel laf = UIManager.getLookAndFeel();
    if (laf instanceof AbstractLookAndFeel && orgBorder instanceof UIResource) {
      Border focusBorder = ((AbstractLookAndFeel)laf).getBorderFactory().getFocusFrameBorder();
      getComponent().setBorder(focusBorder);
    }
    getComponent().invalidate();
    getComponent().repaint();
  }
}

代码示例来源:origin: com.jtattoo/JTattoo

public void focusGained(FocusEvent e) {
  if (getComponent() != null) {
    orgBorder = getComponent().getBorder();
    LookAndFeel laf = UIManager.getLookAndFeel();
    if (laf instanceof AbstractLookAndFeel && orgBorder instanceof UIResource) {
      Border focusBorder = ((AbstractLookAndFeel)laf).getBorderFactory().getFocusFrameBorder();
      getComponent().setBorder(focusBorder);
    }
    getComponent().invalidate();
    getComponent().repaint();
  }
}

代码示例来源:origin: com.jtattoo/JTattoo

public void focusGained(FocusEvent e) {
  if (getComponent() != null) {
    orgBorder = getComponent().getBorder();
    LookAndFeel laf = UIManager.getLookAndFeel();
    if (laf instanceof AbstractLookAndFeel && orgBorder instanceof UIResource) {
      Border focusBorder = ((AbstractLookAndFeel)laf).getBorderFactory().getFocusFrameBorder();
      getComponent().setBorder(focusBorder);
    }
    getComponent().invalidate();
    getComponent().repaint();
  }
}

代码示例来源:origin: com.jtattoo/JTattoo

public void focusGained(FocusEvent e) {
  if (getComponent() != null) {
    orgBorder = getComponent().getBorder();
    LookAndFeel laf = UIManager.getLookAndFeel();
    if (laf instanceof AbstractLookAndFeel && orgBorder instanceof UIResource) {
      Border focusBorder = ((AbstractLookAndFeel) laf).getBorderFactory().getFocusFrameBorder();
      getComponent().setBorder(focusBorder);
    }
    getComponent().invalidate();
    getComponent().repaint();
  }
}

代码示例来源:origin: atarw/material-ui-swing

private void installMyDefaults() {
  this.activeBackground = UIManager.getColor("TextField.selectionBackground");
  this.activeForeground = UIManager.getColor("TextField.selectionForeground");
  this.inactiveBackground = UIManager.getColor("TextField.inactiveBackground");
  this.inactiveForeground = UIManager.getColor("TextField.inactiveForeground");
  getComponent().setFont(MaterialFonts.REGULAR);
  getComponent().setSelectionColor(getComponent().hasFocus() && getComponent().isEnabled() ? activeBackground : inactiveBackground);
  getComponent().setSelectedTextColor(getComponent().hasFocus() && getComponent().isEnabled() ? activeForeground : inactiveForeground);
  getComponent().setForeground(getComponent().hasFocus() && getComponent().isEnabled() ? activeForeground : inactiveForeground);
  getComponent().setBorder(BorderFactory.createEmptyBorder(3, 5, 2,5));
}
@Override

相关文章

JTextComponent类方法