Package javax.swing

Examples of javax.swing.JFrame.dispose()


        JFrame frame = new JFrame("Am I on EDT?");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.add(new JButton("JButton"));
        frame.pack();
        frame.setVisible(true);
        frame.dispose();
    }

    //this test must pass
    static void imageUpdateTest() {
        JFrame frame = new JFrame();
View Full Code Here


            cb_seconds.setSelectedItem(i_movesPerSecond);
            cb_seconds.addActionListener(new ActionListener(){
                @Override
                public void actionPerformed(ActionEvent ae) {
                    i_movesPerSecond = (Integer)cb_seconds.getSelectedItem();
                    f_options.dispose();
                }
            });
            f_options.setVisible(true);
        } else if (ae.getSource().equals(mi_game_autofill)) {
            final JFrame f_autoFill = new JFrame();
View Full Code Here

                @Override
                public void actionPerformed(ActionEvent e) {
                    if (cb_percent.getSelectedIndex() > 0) {
                        gb_gameBoard.resetBoard();
                        gb_gameBoard.randomlyFillBoard((Integer)cb_percent.getSelectedItem());
                        f_autoFill.dispose();
                    }
                }
            });
            f_autoFill.setVisible(true);
        } else if (ae.getSource().equals(mi_game_reset)) {
View Full Code Here

       }
        });
        JButton quitButton = new JButton("Quit Testing");
        quitButton.addActionListener( new ActionListener(){
    public void actionPerformed(ActionEvent ae){
            test.dispose();
            test.setVisible(false);
      System.exit(0);
         }
        });
        c.add(quitButton, BorderLayout.SOUTH);
View Full Code Here

        bottom.add(bCancel);
        bCancel.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent ae){
      System.out.println(jfc.getPreviewFont().toString());
      test.dispose();
      test.setVisible(false);
            System.exit(0);
          }
  });
View Full Code Here

  {
    JFrame frame = (JFrame) SwingUtilities.windowForComponent(this);

    if (frame != null)
    {
      frame.dispose();
    }
  }

  /**
   *
 
View Full Code Here

                '2', KeyEvent.KEY_LOCATION_UNKNOWN));
        assertEquals(new TreePath[] { path2 }, tree.getSelectionPaths());
        handler.keyTyped(new KeyEvent(tree, KeyEvent.KEY_TYPED, 0, 0, KeyEvent.VK_UNDEFINED,
                '1', KeyEvent.KEY_LOCATION_UNKNOWN));
        assertEquals(new TreePath[] { path2 }, tree.getSelectionPaths());
        f.dispose();
    }

    public void testComponentHandler() throws Exception {
        JScrollPane pane = new JScrollPane(tree);
        assertFalse(hasListener(tree.getComponentListeners(),
View Full Code Here

                .getPropertyChangeListeners()));
        // componentListener
        assertTrue("componentListener != null", ui.componentListener != null);
        assertTrue("componentListener installed", belongs(ui.componentListener, frame
                .getParent().getComponentListeners()));
        f.dispose();
    }

    /*
     * Class under test for void uninstallListeners()
     */
 
View Full Code Here

        assertFalse("propertyChangeListener uninstalled", belongs(ui.propertyChangeListener,
                frame.getPropertyChangeListeners()));
        // componentListener
        assertFalse("componentListener uninstalled", belongs(ui.componentListener, frame
                .getComponentListeners()));
        f.dispose();
    }

    /*
     * Class under test for void setupMenuCloseKey()
     */
 
View Full Code Here

        manager.setSelectedPath(new MenuElement[] { menuBar });
        assertEquals(1, menuItemUI.getPath().length);
        assertSame(item, menuItemUI.getPath()[0]);
        manager.clearSelectedPath();
        assertEquals(0, menuItemUI.getPath().length);
        frame.dispose();
    }

    /*
     * Test method for 'javax.swing.plaf.basic.BasicMenuItemUI.doClick(MenuSelectionManager)'
     */
 
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.