/** * Creates a new {@code JFrame} and uses the given {@code Container} as its content pane. The created {@code JFrame} * is wrapped and displayed by a {@link FrameFixture}. It uses the given {@code Robot}, if you've created your own * {@code Robot} this method is best for you, if not use {@code #showInFrame(Container)}. * * @param robot performs user events on the given window and verifies expected output. * @param contentPane the {@code Container} to use as content pane for the {@code JFrame} to create. * @return the created {@code FrameFixture}. * @see #frameFor(Container) */ @RunsInEDT @Nonnull public static FrameFixture showInFrame(@Nonnull Robot robot, @Nonnull Container contentPane) { FrameFixture frameFixture = frameFixtureFor(robot, contentPane); frameFixture.show(); return frameFixture; }
/** * Creates a new {@code JFrame} and uses the given {@code Container} as its content pane. The created {@code JFrame} * is wrapped and displayed by a {@link FrameFixture}. * <p> * <strong>Note:</strong>This method creates a new {@link Robot}. When using this method, please do not create any * additional instances of {@code Robot}. Only one instance of {@code Robot} can exist per test class. If you've * created your own {@code Robot} e.g. by extending the base test class, use {@code #showInFrame(Robot, Container)}. * </p> * * @param contentPane the {@code Container} to use as content pane for the {@code JFrame} to create. * @return the created {@code FrameFixture}. * @see #frameFor(Container) */ @RunsInEDT @Nonnull public static FrameFixture showInFrame(@Nonnull Container contentPane) { FrameFixture frameFixture = frameFixtureFor(contentPane); frameFixture.show(); return frameFixture; }