Class Containers

java.lang.Object
org.fest.swing.fixture.Containers

public final class Containers extends Object
Understands utility methods related to Containers.
Since:
1.2
  • Field Details

    • CREATED_FRAME_NAME

      public static final String CREATED_FRAME_NAME
      Name of the JFrames created by this class.
      See Also:
  • Constructor Details

    • Containers

      private Containers()
  • Method Details

    • showInFrame

      @RunsInEDT public static FrameFixture showInFrame(Container contentPane)
      Creates a new JFrame and uses the given Container as its content pane. The created JFrame is wrapped and displayed by a FrameFixture.

      Note:This method creates a new Robot. When using this method, please do not create any additional instances of Robot. Only one instance of Robot can exist per test class.

      Parameters:
      contentPane - the Container to use as content pane for the JFrame to create.
      Returns:
      the created FrameFixture.
      See Also:
    • frameFixtureFor

      @RunsInEDT public static FrameFixture frameFixtureFor(Container contentPane)
      Creates a new JFrame and uses the given Container as its content pane. The created JFrame is wrapped by a FrameFixture. Unlike showInFrame(Container), this method does not display the created JFrame.

      Note:This method creates a new Robot. When using this method, please do not create any additional instances of Robot. Only one instance of Robot can exist per test class.

      Parameters:
      contentPane - the Container to use as content pane for the JFrame to create.
      Returns:
      the created FrameFixture.
      See Also:
    • frameFor

      @RunsInEDT public static JFrame frameFor(Container contentPane)
      Creates a new JFrame and uses the given Container as its content pane. The created JFrame has the name specified by CREATED_FRAME_NAME. This method is executed in the Event Dispatch Thread (EDT.)
      Parameters:
      contentPane - the Container to use as content pane for the JFrame to create.
      Returns:
      the created JFrame.