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

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

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

JTextArea.setDisabledTextColor介绍

暂无

代码示例

代码示例来源:origin: jshiell/checkstyle-idea

/**
 * Initialise the view.
 */
private void initialise() {
  // fake a multi-line label with a text area
  descriptionLabel.setText(CheckStyleBundle.message("config.inspection.description"));
  descriptionLabel.setEditable(false);
  descriptionLabel.setEnabled(false);
  descriptionLabel.setWrapStyleWord(true);
  descriptionLabel.setLineWrap(true);
  descriptionLabel.setOpaque(false);
  descriptionLabel.setDisabledTextColor(descriptionLabel.getForeground());
  final GridBagConstraints descLabelConstraints = new GridBagConstraints(
      0, 0, 3, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST,
      GridBagConstraints.BOTH, JBUI.insets(4), 0, 0);
  add(descriptionLabel, descLabelConstraints);
}

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

public void SetStyleForTextAreaLabel( JTextArea ta) {
  ta.setEditable( false);
  ta.setLineWrap( true);
  ta.setWrapStyleWord( true);
  ta.setDisabledTextColor( Color.black);
  ta.setBackground( this.getBackground());
}

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

JTextArea a = new JTextArea("test");
a.setEnabled(false);
a.setDisabledTextColor(Color.red);

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-groovy-support

private JTextComponent createMultilineLabel(String text) {
  JTextArea textArea = new JTextArea(text);
  textArea.setEditable(false);
  textArea.setLineWrap(true);
  textArea.setWrapStyleWord(true);
  textArea.setEnabled(false);
  textArea.setOpaque(false);
  textArea.setColumns(25);
  textArea.setDisabledTextColor(new JLabel().getForeground());
  return textArea;
}

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

/**
 * Code common to error() warning().
 */
private static JComponent errorWarning(String msg) {
  JPanel panel = new JPanel();
  panel.setLayout(new BorderLayout());
  JTextArea textArea = new JTextArea();
  Catalog.setAccessibleName(textArea,
    "ACSN_WarningArea");	// NOI18N
  Catalog.setAccessibleDescription(textArea,
    "ACSD_WarningArea");	// NOI18N
  textArea.setLineWrap(false);
  textArea.setEditable(false);
  textArea.setFont(UIManager.getFont("Label.font"));	// NOI18N
  textArea.setDisabledTextColor(UIManager.getColor("Label.foreground")); // NOI18N
  textArea.setColumns(60);
  textArea.setRows(7);
  JScrollPane scrollPane = new JScrollPane();
  scrollPane.setViewportView(textArea);
  Catalog.setAccessibleDescription(scrollPane, "ACSD_Warning");// NOI18N
  textArea.setText(msg);
  return scrollPane;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-gsf-testrunner-ui

/**
 * Creates a text component to be used as a multi-line, automatically
 * wrapping label.
 * <p>
 * <strong>Restriction:</strong><br>
 * The component may have its preferred size very wide.
 *
 * @return  created multi-line text component
 */
private Component createMessagePanel() {
  if (txtAreaMessage == null) {
    JTextArea textArea = new JTextArea("");
    textArea.setEditable(false);
    textArea.setLineWrap(true);
    textArea.setWrapStyleWord(true);
    textArea.setEnabled(false);
    textArea.setOpaque(false);
    textArea.setColumns(25);
  Color color = UIManager.getColor("nb.errorForeground");         //NOI18N
  if (color == null) {
    color = new Color(89, 79, 191);   //RGB suggested by Bruce in #28466
  }
    textArea.setDisabledTextColor(color);
    txtAreaMessage = textArea;
  }
  return txtAreaMessage;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-j2ee-sun-appsrv

private void initDescriptionComponent() {
  java.awt.GridBagConstraints gridBagConstraints;
  descriptionTextArea = new javax.swing.JTextArea();
  descriptionTextArea.setEditable(false);
  descriptionTextArea.setFont(javax.swing.UIManager.getFont("Label.font")); //NOI18N
  descriptionTextArea.setText(bundle.getString(this.resourceName + "_Description"));  //NOI18N
  descriptionTextArea.setDisabledTextColor(javax.swing.UIManager.getColor("Label.foreground"));  //NOI18N
  descriptionTextArea.setRequestFocusEnabled(false);
  descriptionTextArea.setEnabled(false);
  descriptionTextArea.setOpaque(false);
  gridBagConstraints = new java.awt.GridBagConstraints();
  gridBagConstraints.gridx = 0;
  gridBagConstraints.gridy = this.y; this.y++;
  gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
  gridBagConstraints.weightx = 1.0;
  gridBagConstraints.weighty = 0.0;
  gridBagConstraints.insets = new java.awt.Insets(12, 12, 20, 11);
  add(descriptionTextArea, gridBagConstraints);        
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-j2ee-sun-appsrv

private void initDescriptionComponent() {
  java.awt.GridBagConstraints gridBagConstraints;
  
  descriptionTextArea = new javax.swing.JTextArea();
  descriptionTextArea.setEditable(false);
  descriptionTextArea.setFont(javax.swing.UIManager.getFont("Label.font")); //NOI18N
  descriptionTextArea.setText(bundle.getString(this.resourceName + "_Description"));  //NOI18N
  descriptionTextArea.setDisabledTextColor(javax.swing.UIManager.getColor("Label.foreground"));  //NOI18N
  descriptionTextArea.setRequestFocusEnabled(false);
  descriptionTextArea.setEnabled(false);
  descriptionTextArea.setOpaque(false);
  gridBagConstraints = new java.awt.GridBagConstraints();
  gridBagConstraints.gridx = 0;
  gridBagConstraints.gridy = this.y; this.y++;
  gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
  gridBagConstraints.weightx = 1.0;
  gridBagConstraints.weighty = 0.0;
  gridBagConstraints.insets = new java.awt.Insets(12, 12, 20, 11);
  add(descriptionTextArea, gridBagConstraints);        
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-jsf-navigation

private void initComponents() {
  JTextArea localTopMessage = new javax.swing.JTextArea();
  jCheckBox1 = new javax.swing.JCheckBox();
  
  setLayout(new java.awt.BorderLayout(0, 12));
  
  setBorder(new javax.swing.border.EmptyBorder(new java.awt.Insets(5, 5, 5, 5)));
  getAccessibleContext().setAccessibleDescription(msg);
  
  localTopMessage.setLineWrap (true);
  localTopMessage.setWrapStyleWord (true);
  localTopMessage.setEditable (false);
  localTopMessage.setEnabled (false);
  localTopMessage.setOpaque (false);
  localTopMessage.setDisabledTextColor (javax.swing.UIManager.getColor ("Label.foreground"));  // NOI18N
  localTopMessage.setFont (javax.swing.UIManager.getFont ("Label.font")); // NOI18N
  StringBuilder lTopMessage = new StringBuilder();
  lTopMessage.append(msg);
  localTopMessage.setText(lTopMessage.toString());
  add(localTopMessage, java.awt.BorderLayout.NORTH);
  
  Mnemonics.setLocalizedText(jCheckBox1, NbBundle.getMessage (NotWebFolder.class, "CTL_ShowDialog"));
  jCheckBox1.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage (NotWebFolder.class, "ACSD_CTL_ShowDialog"));
  add(jCheckBox1, java.awt.BorderLayout.SOUTH);
}

代码示例来源:origin: ata4/bspsrc

messageTextArea.setFont(new java.awt.Font("Monospaced", 0, 12)); // NOI18N
messageTextArea.setRows(1);
messageTextArea.setDisabledTextColor(new java.awt.Color(0, 0, 0));
messageScrollPane.setViewportView(messageTextArea);

代码示例来源:origin: jboss.remoting/jboss-remoting

exitButton.addActionListener(new TalkFrame_exitButton_actionAdapter(this));
backChatTextArea.setFont(new java.awt.Font("Monospaced", 0, 13));
backChatTextArea.setDisabledTextColor(Color.white);
backChatTextArea.setEditable(false);
backChatTextArea.setText("");

代码示例来源:origin: net.java.abeille/abeille

collisionLabel.setForeground(java.awt.Color.red);
collisionLabel.setBackground(getBackground());
collisionLabel.setDisabledTextColor(java.awt.Color.red);
collisionLabel.setEnabled(false);
gridBagConstraints = new java.awt.GridBagConstraints();

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/org-netbeans-modules-editor-lib

collisionLabel.setForeground(java.awt.Color.red);
collisionLabel.setBackground(getBackground());
collisionLabel.setDisabledTextColor(java.awt.Color.red);
collisionLabel.setEnabled(false);
gridBagConstraints = new java.awt.GridBagConstraints();

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

warningText.setText(org.openide.util.NbBundle.getMessage(DefaultProjectDeletePanel.class, "LBL_Pre_Delete_Warning", new Object[] {projectDisplaName})); // NOI18N
warningText.setWrapStyleWord(true);
warningText.setDisabledTextColor(javax.swing.UIManager.getColor("Label.foreground")); // NOI18N
warningText.setOpaque(false);
gridBagConstraints = new java.awt.GridBagConstraints();

代码示例来源:origin: tulskiy/musique

status.setFont(status.getFont().deriveFont(11f));
status.setEnabled(false);
status.setDisabledTextColor(Color.black);
JButton cancel = new JButton("Abort");
cancel.addActionListener(new ActionListener() {

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

textArea.setOpaque(false);
textArea.setFont(UIManager.getFont("Label.font"));	// NOI18N
textArea.setDisabledTextColor(
  UIManager.getColor("Label.foreground")); // NOI18N
Catalog.setAccessibleName(panel, "ACSD_StartNewSession"); // NOI18N

代码示例来源:origin: sarahtattersall/PIPE

/**
 * Initialize with an (x,y) location
 * @param x coordinate
 * @param y coordinate 
 */
private void initialize(int x, int y) {
  originalX = x;
  originalY = y;
  noteText.setAlignmentX(Component.CENTER_ALIGNMENT);
  noteText.setAlignmentY(Component.CENTER_ALIGNMENT);
  noteText.setOpaque(false);
  noteText.setEditable(false);
  noteText.setEnabled(false);
  noteText.setLineWrap(true);
  noteText.setWrapStyleWord(true);
  // Set minimum size the preferred size for an empty string:
  noteText.setText("");
  noteText.setFont(
      new Font(GUIConstants.ANNOTATION_DEFAULT_FONT, Font.PLAIN, GUIConstants.ANNOTATION_DEFAULT_FONT_SIZE));
  noteText.setSize(noteText.getPreferredSize().width, noteText.getPreferredSize().height);
  noteText.setMinimumSize(noteText.getPreferredSize());
  noteText.setHighlighter(new DefaultHighlighter());
  noteText.setDisabledTextColor(GUIConstants.NOTE_DISABLED_COLOUR);
  noteText.setForeground(GUIConstants.NOTE_EDITING_COLOUR);
  add(noteText);
  setLocation(x - GUIConstants.RESERVED_BORDER / 2, y - GUIConstants.RESERVED_BORDER / 2);
}

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

textArea.setOpaque(false);
textArea.setFont(UIManager.getFont("Label.font"));// NOI18N
textArea.setDisabledTextColor(UIManager.getColor("Label.foreground")); // NOI18N
panel.add(textArea, BorderLayout.CENTER);

代码示例来源:origin: com.davidbracewell/hermes-core

lines.setDisabledTextColor(Color.DARK_GRAY);
lines.setFont(new Font(Font.MONOSPACED, Font.PLAIN, editorPane.getFont().getSize()));
editorPane.getStyledDocument().addDocumentListener(new DocumentListener() {

相关文章

JTextArea类方法