Package javax.swing

Examples of javax.swing.JWindow


 
  @Test
  public void testUpdatesIcon() {
    // Note: Font rendering context is needed for character shapes, so show legend entry on screen
   
    JWindow w = new JWindow();
    w.getContentPane().add(legendEntry);
    w.setVisible(true);
    w.pack();
   
    Mockito.when(mockPlotLine.getPointIcon()).thenReturn(mockIcon);
    int i = 0;
    for (boolean b : new boolean[]{false, true}) {
      Mockito.verify(mockPlotLine, Mockito.times(i)).setPointIcon(Mockito.<Icon>any());
      Mockito.when(mockSettings.getUseCharacter()).thenReturn(b);
      Mockito.when(mockSettings.getMarker()).thenReturn(0);
      Mockito.when(mockSettings.getCharacter()).thenReturn("X");
      legendEntry.setLineSettings(mockSettings);
      Mockito.verify(mockPlotLine, Mockito.times(++i)).setPointIcon(Mockito.<Icon>any());     
    }   
   
    w.setVisible(false);
    w.dispose();
  }
View Full Code Here


// Une JWindow pour le Menu:
   
    SwingUtilities.invokeLater(new Runnable() {
      public void run() {
        //On crée une nouvelle instance de notre JWindow
        final JWindow startMenu = new JWindow();
        startMenu.setSize(550, 400); // On lui donne une taille pour la voir
        startMenu.setLocationRelativeTo(null);// On centre le menu
        Panel content = new Panel();
        startMenu.getContentPane().add(content);
        startMenu.setVisible(true); // On l'a rend visible
        content.setBackground(new Color(212,154,76));
       
        JLabel title = new JLabel("Tower Carlotta Towa");
        title.setPreferredSize(new Dimension(380, 50));
        title.setBounds(120,10,380,50);
        Font font = new Font("Serif", Font.PLAIN, 32);
        title.setFont(font);
        content.add(title);
       
        JButton startGame = new JButton("Start the Game !");
        content.setLayout(null);
        startGame.setBounds(200, 200, 160, 25);
        startGame.setBackground(new Color(108,146,212));
        startGame.setBorderPainted(false);
        content.add(startGame);
       
        startGame.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent e) {     
            SwingUtilities.invokeLater(new Runnable() {
             
              public void run() {
                // We create the new instance of the JFrame to run the game
                AppliWindow window;
                try {
                  // AppliWindow is a Singleton
                  window = AppliWindow.getInstance();
                  window.init("Tower-IMAC Carlotta Towa", 800, 700, true, Theme.pathImageMap);
                  window.setVisible(true); // And we make it visible
                } catch (MapFileException e) {
                  e.printStackTrace();
                } catch (JDOMException e) {
                  e.printStackTrace();
                } catch (IOException e) {
                  e.printStackTrace();
                } catch (RealPlayerException e) {
                  e.printStackTrace();
                }
              }
            });
            //We hide the menu starter
            startMenu.dispose();
          }
        });
       
       
        JButton quitGame = new JButton("Exit");
View Full Code Here

   
    /** Toggle the visiblity of the date picker selection popup.  This is used as a response to the
     * combo box toggle button, but it can be manually toggled as well if there is some need. */
    public void showDatePicker() {
        if (datePickerWindow == null) {
            datePickerWindow = new JWindow(getFrame(null));
            datePickerWindow.setAlwaysOnTop(true);
            datePicker = new JDatePicker();
            datePickerWindow.getContentPane().add(datePicker);
            datePickerWindow.addWindowFocusListener(windowFocusListener);
            datePicker.setBorder(BorderFactory.createLineBorder(Color.BLACK));
View Full Code Here

    private void initComponents() {
        completer = new Completer();
        completionListModel = new DefaultListModel();
        completionList = new JList(completionListModel);
        completionList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        listWindow = new JWindow();
        com.sun.awt.AWTUtilities.setWindowOpacity(listWindow, 0.9f);
        listWindow.getContentPane().add(completionList);     
    }
View Full Code Here

        public FullScreenAction() {}

        public void actionPerformed(ActionEvent e) {
            if (window == null || !window.isVisible()) {
                if (window == null) {
                    window = new JWindow(JSVGViewerFrame.this);
                    Dimension size = Toolkit.getDefaultToolkit().getScreenSize();
                    window.setSize(size);
                }
                // Go to full screen in JWindow)
                svgCanvas.getParent().remove(svgCanvas);
View Full Code Here

                                    BufferedImage.TYPE_INT_BGR);

        Thread t = new RenderThread();
        t.start();

        JWindow w = new JWindow();
        w.setBackground(Color.black);
        w.getContentPane().setBackground(Color.black);
        w.getContentPane().add(this);
        w.pack();
        w.setLocation(new Point(-1, -1));
        w.setVisible(true);
    }
View Full Code Here

    m_showFileMenu = showFileMenu;

    // end modifications by Zerbetto
    // Grab a fontmetrics object
    JWindow temp = new JWindow();
    temp.setVisible(true);
    temp.getGraphics().setFont(new Font("Monospaced", Font.PLAIN, 10));
    m_fontM = temp.getGraphics().getFontMetrics();
    temp.setVisible(false);

    // some GUI defaults
    try {
      m_ScrollBarIncrementLayout = Integer.parseInt(
          BEAN_PROPERTIES.getProperty(
View Full Code Here

        splashPicAndText.setLayout(new BorderLayout());
        splashPicAndText.setBorder(BorderFactory.createLineBorder(Color.black,
                                                                  5));
        splashPicAndText.add(m_aboutPic, BorderLayout.CENTER);
        splashPicAndText.add(m_aboutText, BorderLayout.SOUTH);
        JWindow splashScreen = new JWindow();
        splashScreen.getContentPane().add(splashPicAndText);
        splashScreen.pack();
        int xSize = splashScreen.getWidth();
        int ySize = splashScreen.getHeight();
        Dimension screenSize = getToolkit().getScreenSize();
        int xLoc = screenSize.width / 2 - xSize / 2;
        int yLoc = screenSize.height / 2 - ySize / 2;
        splashScreen.setBounds(xLoc, yLoc, xSize, ySize);
        splashScreen.setVisible(true);

        ImageIcon fedoraIcon =
                new ImageIcon(ClassLoader.getSystemResource("images/client/fedora/fedora-icon16.gif"));
        setIconImage(fedoraIcon.getImage());
        JPanel mainPanel = new JPanel();
        mainPanel.setLayout(new BorderLayout());
        s_desktop = new MDIDesktopPane();
        s_desktop.setBackground(DESKTOP_COLOR);
        s_desktop.setVisible(true);
        mainPanel.add(new JScrollPane(s_desktop), BorderLayout.CENTER);
        PROGRESS = new JProgressBar(0, 2000);
        PROGRESS.setValue(0);
        PROGRESS.setStringPainted(true);
        PROGRESS.setString("");

        mainPanel.add(PROGRESS, BorderLayout.SOUTH);

        getContentPane().add(mainPanel);
        setJMenuBar(createMenuBar());

        //Make dragging faster:
        //s_desktop.putClientProperty("JDesktopPane.dragMode", "outline");

        addWindowListener(new WindowAdapter() {

            @Override
            public void windowClosing(WindowEvent e) {
                dispose();
                System.exit(0);
            }
        });

        splashScreen.setVisible(false);
        s_instance = this;

        int xs = 1000;
        int ys = 744;
        Dimension sz = getToolkit().getScreenSize();
View Full Code Here

  }
 
  private void afficher_chargement() {
   

    JWindow window = new JWindow();
    window.setSize(new Dimension(this.getWidth(),this.getHeight()-48));//On lui donne une taille pour qu'on puisse la voir
    window.setLocationRelativeTo(this);
    window.setLocation(0,48);
    JPanel pane = new JPanel();
    pane.setLayout(new FlowLayout());
    pane.setBackground(Color.RED);
    JLabel label = new JLabel("Loading Neuronux ...");
    JProgressBar b = new JProgressBar(JProgressBar.HORIZONTAL,0,100);
    pane.add(label);
    pane.add(b);
    pane.setBounds(this.getWidth(), this.getHeight(), 350, 35);
    this.add(pane);
    window.setContentPane(pane);
    window.setAlwaysOnTop(true);
    window.setVisible(true);//On la rend visible
    for (int i = 0; i < 100; i++){
    b.setValue(i);
    try {
      Thread.sleep(10);
    } catch (InterruptedException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    }
    this.remove(pane);
    window.dispose();//On la detruit
  }
View Full Code Here

        public FullScreenAction() {}

        public void actionPerformed(ActionEvent e) {
            if (window == null || !window.isVisible()) {
                if (window == null) {
                    window = new JWindow(JSVGViewerFrame.this);
                    Dimension size = Toolkit.getDefaultToolkit().getScreenSize();
                    window.setSize(size);
                }
                // Go to full screen in JWindow)
                svgCanvas.getParent().remove(svgCanvas);
View Full Code Here

TOP

Related Classes of javax.swing.JWindow

Copyright © 2018 www.massapicom. 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.