Example usage for javax.swing JTextArea getBackground

List of usage examples for javax.swing JTextArea getBackground

Introduction

In this page you can find the example usage for javax.swing JTextArea getBackground.

Prototype

@Transient
public Color getBackground() 

Source Link

Document

Gets the background color of this component.

Usage

From source file:org.pentaho.reporting.engine.classic.core.modules.gui.base.parameters.TextAreaParameterComponentTest.java

@Test
public void testInitializeErrorFormattedValue() throws Exception {
    final CountDownLatch latch = new CountDownLatch(1);
    doReturn("error value").when(updateContext).getParameterValue(ENTRY_NAME);

    comp.initialize();//from   w ww .  j  av a  2  s .  co  m

    SwingUtilities.invokeLater(() -> latch.countDown());

    latch.await(100, TimeUnit.MILLISECONDS);

    JTextArea textArea = findTextArea(comp);
    assertThat(textArea, is(notNullValue()));
    assertThat(textArea.getText(), is(equalTo("error value")));
    assertThat(textArea.getBackground(), is(equalTo(Color.RED)));
    assertThat(comp.getBackground(), is(equalTo(ParameterReportControllerPane.ERROR_COLOR)));
}