Package javax.swing

Examples of javax.swing.JFrame.validate()


        StatusBar statusBar = new StatusBar();
        JFrame frame = new JFrame();
        frame.add(statusBar, BorderLayout.CENTER);
        FrameFixture frameFixture = new FrameFixture(robot, frame);
        frame.setSize(400, 30);
        frame.validate();
        frameFixture.show();

        // Previous test checks two-digit field values, this test checks that single-digit
        // values and zeros are correctly padded.
        statusBar.populationUpdate(new PopulationData<Object>(new Object(), 10, 8, 2, true, 10, 1, 0, 1000));
View Full Code Here


        JFrame frame = new JFrame();
        frame.add(control.getControl(), BorderLayout.CENTER);
        FrameFixture frameFixture = new FrameFixture(robot, frame);
        frame.setSize(300, 50);
        frame.validate();
        frame.setVisible(true);

        JSlider slider = frameFixture.slider().component();
        assert slider.getValue() == 75 : "Wrong slider position: " + slider.getValue();
        String displayedValue = frameFixture.label().text();
View Full Code Here

        JFrame frame = new JFrame();
        frame.add(control.getControl(), BorderLayout.CENTER);
        FrameFixture frameFixture = new FrameFixture(robot, frame);
        frame.setSize(300, 50);
        frame.validate();
        frame.setVisible(true);

        JSlider slider = frameFixture.slider().component();
        frameFixture.slider().slideTo(80); // 80 ticks is a probability of 0.8.
View Full Code Here

        final SwingConsole swingConsole = new SwingConsole();
        JFrame frame = new JFrame();
        frame.add(swingConsole, BorderLayout.CENTER);
        FrameFixture frameFixture = new FrameFixture(robot, frame);
        frame.setSize(300, 100);
        frame.validate();
        frame.setVisible(true);

        final List<JLabel> labels = Arrays.asList(new JLabel("Zero"),
                                                  new JLabel("One"),
                                                  new JLabel("Two"));
View Full Code Here

        SudokuView view = new SudokuView();
        JFrame frame = new JFrame();
        frame.add(view, BorderLayout.CENTER);
        FrameFixture frameFixture = new FrameFixture(robot, frame);
        frame.setSize(400, 400);
        frame.validate();

        frameFixture.show();
        view.setPuzzle(TEST_PUZZLE);

        // Check a non-empty cell.
View Full Code Here

        SudokuView view = new SudokuView();
        JFrame frame = new JFrame();
        frame.add(view, BorderLayout.CENTER);
        FrameFixture frameFixture = new FrameFixture(robot, frame);
        frame.setSize(400, 400);
        frame.validate();

        frameFixture.show();
        Sudoku sudoku = SudokuTestUtils.createSudoku(new int[][]
        {
            {1, 2, 8, 5, 4, 3, 9, 6, 7},
View Full Code Here

        ItineraryPanel itineraryPanel = new ItineraryPanel(CITIES.getKnownCities());
        JFrame frame = new JFrame();
        frame.add(itineraryPanel, BorderLayout.CENTER);
        FrameFixture frameFixture = new FrameFixture(robot, frame);
        frame.setSize(100, 300);
        frame.validate();
        frame.setVisible(true);
        assert itineraryPanel.getSelectedCities().isEmpty() : "Should be no cities selected initially.";
        frameFixture.button("All").click();
        Collection<String> selectedCities = itineraryPanel.getSelectedCities();
        assert selectedCities.size() == CITIES.getKnownCities().size()
View Full Code Here

        ItineraryPanel itineraryPanel = new ItineraryPanel(CITIES.getKnownCities());
        JFrame frame = new JFrame();
        frame.add(itineraryPanel, BorderLayout.CENTER);
        FrameFixture frameFixture = new FrameFixture(robot, frame);
        frame.setSize(100, 300);
        frame.validate();
        frame.setVisible(true);
        frameFixture.button("All").click();
        Collection<String> selectedCities = itineraryPanel.getSelectedCities();
        assert selectedCities.size() == CITIES.getKnownCities().size()
            : "All cities should be selected after all button click.";
View Full Code Here

        StrategyPanel strategyPanel = new StrategyPanel(CITIES);
        JFrame frame = new JFrame();
        frame.add(strategyPanel, BorderLayout.CENTER);
        FrameFixture frameFixture = new FrameFixture(robot, frame);
        frame.setSize(500, 300);
        frame.validate();
        frame.setVisible(true);
        robot.waitForIdle();

        // Evolution controls should be enabled by default.
        frameFixture.panel("EvolutionPanel").requireEnabled();
View Full Code Here

        StrategyPanel strategyPanel = new StrategyPanel(CITIES);
        JFrame frame = new JFrame();
        frame.add(strategyPanel, BorderLayout.CENTER);
        FrameFixture frameFixture = new FrameFixture(robot, frame);
        frame.setSize(500, 300);
        frame.validate();
        frame.setVisible(true);
        robot.waitForIdle();

        frameFixture.radioButton("EvolutionOption").click();
        TravellingSalesmanStrategy strategy = strategyPanel.getStrategy();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.