javax.swing.JTextArea.setBackground()方法的使用及代码示例

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

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

JTextArea.setBackground介绍

暂无

代码示例

代码示例来源:origin: redwarp/9-Patch-Resizer

public AboutDialog(JFrame parent) {
  this.setResizable(false);
  this.setSize(new Dimension(400, 250));
  this.getContentPane().setLayout(new BorderLayout(0, 0));
  JLabel lblResizer = new JLabel(Localization.get("app_name") + " "
      + Configuration.getVersion());
  lblResizer.setBorder(new EmptyBorder(10, 10, 10, 10));
  lblResizer.setVerticalTextPosition(SwingConstants.BOTTOM);
  lblResizer.setIconTextGap(10);
  lblResizer.setFont(lblResizer.getFont().deriveFont(
      lblResizer.getFont().getStyle() | Font.BOLD, 16f));
  lblResizer.setIcon(new ImageIcon(AboutDialog.class
      .getResource("/img/icon_64.png")));
  this.getContentPane().add(lblResizer, BorderLayout.NORTH);
  JTextArea txtrResizerIsA = new JTextArea();
  txtrResizerIsA.setEditable(false);
  txtrResizerIsA.setWrapStyleWord(true);
  txtrResizerIsA.setBorder(new EmptyBorder(0, 10, 10, 10));
  txtrResizerIsA.setFont(UIManager.getFont("Label.font"));
  txtrResizerIsA.setLineWrap(true);
  txtrResizerIsA.setText(Localization.get("about_text"));
  txtrResizerIsA.setBackground(new Color(0, 0, 0, 0));
  this.getContentPane().add(txtrResizerIsA, BorderLayout.CENTER);
  this.setLocationRelativeTo(parent);
}

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

private Component text() {
  license = new JTextArea();
  license.setFont(getFont());
  license.setBackground(getBackground());
  license.setEditable(false);
  license.setBorder(BorderFactory.createCompoundBorder(
      BorderFactory.createLineBorder(Color.GRAY), 
      emptyBorder()));
  return license;
}

代码示例来源:origin: magefree/mage

/** This method is called from within the constructor to
 * initialize the form.
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
  popupText = new javax.swing.JTextArea();
  setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
  setLayout(new java.awt.BorderLayout());
  popupText.setBackground(new java.awt.Color(204, 204, 204));
  popupText.setColumns(20);
  popupText.setEditable(false);
  popupText.setLineWrap(true);
  popupText.setRows(1);
  popupText.setWrapStyleWord(true);
  popupText.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 2, 2, 2));
  add(popupText, java.awt.BorderLayout.PAGE_START);
}// </editor-fold>//GEN-END:initComponents

代码示例来源:origin: org.netbeans.api/org-openide-dialogs

area.setBackground(c);

代码示例来源:origin: RaiMan/SikuliX2

tm.setWrapStyleWord(true);
tm.setEditable(false);
tm.setBackground(new JLabel().getBackground());
JPanel pnl = new JPanel();
pnl.setLayout(new BoxLayout(pnl, BoxLayout.Y_AXIS));

代码示例来源:origin: org.netbeans.api/org-openide-dialogs

area.setBackground(UIManager.getColor("Label.background")); // NOI18N
area.setBorder(BorderFactory.createEmptyBorder());
area.setLineWrap(true);

代码示例来源:origin: locationtech/jts

private void setString(String s)
{
 txtResult.setText(s);
 txtResult.setBackground(SystemColor.control);
}

代码示例来源:origin: locationtech/jts

public void setString(String s)
{
 txtResult.setText(s);
 txtResult.setBackground(SystemColor.control);
}

代码示例来源:origin: locationtech/jts

private void setError(Throwable ex)
{
 String exStr = ExceptionFormatter.getFullString(ex);
 txtResult.setText(exStr);
 txtResult.setBackground(Color.pink);
}

代码示例来源:origin: locationtech/jts

private void setGeometry(Geometry g)
{
 String  str = tbModel.getResultDisplayString(g);
 txtResult.setText(str);
 txtResult.setBackground(SystemColor.control);
}

代码示例来源:origin: locationtech/jts

public void setError(Throwable ex)
{
 String exStr = ExceptionFormatter.getFullString(ex);
 txtResult.setText(exStr);
 txtResult.setBackground(Color.pink);
}

代码示例来源:origin: Exslims/MercuryTrade

public JTextArea getSimpleTextArea(String text) {
  JTextArea area = new JTextArea(text);
  area.setEditable(false);
  area.setWrapStyleWord(true);
  area.setLineWrap(true);
  area.setBackground(AppThemeColor.TRANSPARENT);
  area.setBorder(null);
  area.setFont(REGULAR_FONT.deriveFont(scale * 16f));
  area.setForeground(AppThemeColor.TEXT_DEFAULT);
  return area;
}

代码示例来源:origin: stackoverflow.com

JTextArea txt = new JTextArea();
//Set background black
txt.setBackground(Color.BLACK); 
//Set Foreground(text) white
txt.setForeground(Color.WHITE);

代码示例来源:origin: stackoverflow.com

setLayout(null); //change jpanel layout to null
JTextArea name_field=new JTextArea(1,10);
name_field.setBackground(color);
name_field.setBounds(100,100,600,420);
name_field.setLineWrap(true);
add(name_field);

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-makeproject

/** Creates new form ConfigurationWarningPanel */
public ConfigurationWarningPanel(String msg) {
  initComponents();
  messageTextarea.setBackground(new Color(getBackground().getRGB()));
  messageTextarea.setText(msg);
}

代码示例来源:origin: locationtech/jts

private void setFocusGeometry(int index) {
 JTSTestBuilder.controller().setFocusGeometry(index);
 
 JTextArea focusTA = index == 0 ? aTextArea : bTextArea;
 JTextArea otherTA = index == 0 ? bTextArea : aTextArea;
 //focusTA.setBorder(focusBorder);
 //otherTA.setBorder(otherBorder);
 
 focusTA.setBackground(focusBackgroundColor);
 otherTA.setBackground(otherBackgroundColor);
 repaint();
}

代码示例来源:origin: locationtech/jts

void jbInit() throws Exception {
 
 this.setLayout(tabPanelLayout);
 txtStats.setWrapStyleWord(true);
 txtStats.setLineWrap(true);
 txtStats.setBackground(SystemColor.control);
 this.add(jScrollPane1, BorderLayout.CENTER);
 
 jScrollPane1.setBorder(BorderFactory.createLoweredBevelBorder());
 jScrollPane1.getViewport().add(txtStats, null);
}

代码示例来源:origin: locationtech/jts

void jbInit() throws Exception {
 
 this.setLayout(tabPanelLayout);
 txtInfo.setWrapStyleWord(true);
 txtInfo.setLineWrap(true);
 txtInfo.setBackground(SystemColor.control);
 this.add(jScrollPane1, BorderLayout.CENTER);
 
 jScrollPane1.setBorder(BorderFactory.createLoweredBevelBorder());
 jScrollPane1.getViewport().add(txtInfo, null);
}

代码示例来源:origin: org.integratedmodelling/klab-common

/**
 * This is called when the input color is changed so that all input is added with the
 * AttributeSet (Style) that has been specified for input.
 */
private void setInputAttribute() {
  inputControl.setInputAttributeSet(consoleStyledDocument.getStyle(inputColor));
  if (!useInlineInput) {
    inputArea.setForeground(getStyleColorFromCode(inputColor.charAt(0))); // Foreground
    inputArea.setBackground(getStyleColorFromCode(inputColor.charAt(1))); // Background
  }
}

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

private void setBackgroundColors() {
  shellPreview.setBackground(themeData.getColor(ThemeData.SHELL_BACKGROUND_COLOR));
  shellPreview.setSelectionColor(themeData.getColor(ThemeData.SHELL_SELECTED_BACKGROUND_COLOR));
  historyPreview.setBackground(themeData.getColor(ThemeData.SHELL_HISTORY_BACKGROUND_COLOR));
  historyPreview.setSelectionBackground(themeData.getColor(ThemeData.SHELL_HISTORY_SELECTED_BACKGROUND_COLOR));
}

相关文章

JTextArea类方法