Java Code Examples for javax.swing.JTextArea#setVisible()

The following examples show how to use javax.swing.JTextArea#setVisible() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: QOptionPaneUI.java    From pumpernickel with MIT License 5 votes vote down vote up
protected void updateMainMessage(QOptionPane pane) {
	String mainMessage = pane.getMainMessage();
	JTextArea textArea = getMainMessageTextArea(pane);
	if (mainMessage == null) {
		textArea.setText("");
		textArea.setVisible(false);
	} else {
		textArea.setText(mainMessage);
		textArea.setVisible(true);
	}
}
 
Example 2
Source File: QOptionPaneUI.java    From pumpernickel with MIT License 5 votes vote down vote up
protected void updateSecondaryMessage(QOptionPane pane) {
	String secondaryMessage = pane.getSecondaryMessage();
	JTextArea textArea = getSecondaryMessageTextArea(pane);
	if (secondaryMessage == null) {
		textArea.setText("");
		textArea.setVisible(false);
	} else {
		textArea.setText(secondaryMessage);
		textArea.setVisible(true);
	}
}
 
Example 3
Source File: UnitChooser.java    From triplea with GNU General Public License v3.0 4 votes vote down vote up
private void layoutEntries() {
  this.setLayout(new GridBagLayout());
  title = new JTextArea();
  title.setBackground(this.getBackground());
  title.setEditable(false);
  title.setWrapStyleWord(true);
  title.setVisible(false);
  final Insets nullInsets = new Insets(0, 0, 0, 0);
  final Dimension buttonSize = new Dimension(80, 20);
  selectNoneButton = new JButton("None");
  selectNoneButton.setPreferredSize(buttonSize);
  autoSelectButton = new JButton("All");
  autoSelectButton.setPreferredSize(buttonSize);
  add(
      title,
      new GridBagConstraints(
          0,
          0,
          7,
          1,
          0,
          0.5,
          GridBagConstraints.EAST,
          GridBagConstraints.HORIZONTAL,
          nullInsets,
          0,
          0));
  selectNoneButton.addActionListener(e -> selectNone());
  autoSelectButton.addActionListener(e -> autoSelect());
  int rowIndex = 1;
  for (final ChooserEntry entry : entries) {
    entry.createComponents(this, rowIndex);
    rowIndex++;
  }
  add(
      autoSelectButton,
      new GridBagConstraints(
          0,
          rowIndex,
          7,
          1,
          0,
          0.5,
          GridBagConstraints.EAST,
          GridBagConstraints.NONE,
          nullInsets,
          0,
          0));
  rowIndex++;
  add(
      leftToSelect,
      new GridBagConstraints(
          0,
          rowIndex,
          5,
          2,
          0,
          0.5,
          GridBagConstraints.WEST,
          GridBagConstraints.HORIZONTAL,
          nullInsets,
          0,
          0));
  if (match != null) {
    autoSelectButton.setVisible(false);
    selectNoneButton.setVisible(false);
    checkMatches();
  }
}