/** * Creates a new {@code JFrame} and uses the given {@code Container} as its content pane. The created {@code JFrame} * is wrapped by a {@link FrameFixture}. Unlike {@link #showInFrame(Container)}, this method does <strong>not</strong> * display the created {@code JFrame}. It uses the given {@code Robot}, if you've created your own {@code Robot} this * method is best for you, if not use {@code #frameFixtureFor(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 frameFixtureFor(@Nonnull Robot robot, @Nonnull Container contentPane) { return new FrameFixture(robot, frameFor(contentPane)); }
/** * Creates a new {@code JFrame} and uses the given {@code Container} as its content pane. The created {@code JFrame} * is wrapped by a {@link FrameFixture}. Unlike {@link #showInFrame(Container)}, this method does <strong>not</strong> * display the created {@code JFrame}. * <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 #frameFixtureFor(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 frameFixtureFor(@Nonnull Container contentPane) { return new FrameFixture(frameFor(contentPane)); }