Package javax.swing

Examples of javax.swing.JWindow


                                    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


            JOptionPane.INFORMATION_MESSAGE) != JOptionPane.YES_OPTION) {
        return;
      }
    }

    final JWindow progressWindow = new JWindow();
    final ProgressPanel panel = new ProgressPanel(1, 3, "Shutting down");
    progressWindow.getContentPane().add(panel);
    progressWindow.pack();

    Point p = new Point(getLocation());
    p.move((int) getSize().getWidth() >> 1, (int) getSize().getHeight() >> 1);
    progressWindow.setLocation(p);
    progressWindow.setVisible(true);

    Runnable runnable =
      new Runnable() {
        public void run() {
          try {
            int progress = 1;
            final int delay = 25;

            handler.close();
            panel.setProgress(progress++);

            Thread.sleep(delay);

            pluginRegistry.stopAllPlugins();
            panel.setProgress(progress++);

            Thread.sleep(delay);

            panel.setProgress(progress++);
            Thread.sleep(delay);
          } catch (Exception e) {
            e.printStackTrace();
          }

          fireShutdownEvent();
          performShutdownAction();
          progressWindow.setVisible(false);
        }
      };

    new Thread(runnable).start();
  }
View Full Code Here

   * application.
   *
   * @return Returns a reference to the displaying splash window.
   */
  protected Window createSplashWindow() {
    JWindow splashWindow = new JWindow();

   
   
   
    JLabel image = new JLabel(JGraphEditorResources
        .getImage(PATH_SPLASHIMAGE));
    image.setBorder(BorderFactory.createRaisedBevelBorder());
    splashWindow.getContentPane().add(image, BorderLayout.CENTER);
    JLabel label = new JLabel("v" + VERSION_NUMBER);
    image.setLayout(null);
    image.add(label);
    label.setFont(label.getFont().deriveFont(Font.BOLD));
    label.setForeground(Color.GRAY);
    label.setBounds(202, 118, 200, 30);

   
    splashWindow.pack();
    center(splashWindow);

    return splashWindow;
  }
View Full Code Here

    /**
     * Diplay dialog
     */
    public void display() {
        j = new JWindow();
        j.getContentPane().setLayout(new GridLayout(1, 1));

        GridBagLayout gridbaglayout = new GridBagLayout();

        GridBagConstraints gridbagconstraints = new GridBagConstraints();
View Full Code Here

          break;
        }

//        final boolean versionOK = this.checkVersion();

        this.cover = new JWindow(this.parent) {
            @Override
            public void paint(Graphics g) {
              if (style == XP) {
                Part part = null;
                switch (WindowButtonAdapter.this.type){
View Full Code Here

          break;
        }

//        final boolean versionOK = this.checkVersion();

        this.cover = new JWindow(this.parent) {
            @Override
            public void paint(Graphics g) {
              if (style == XP) {
                Part part = null;
                switch (WindowButtonAdapter.this.type){
View Full Code Here

   */
  public Loading(int max, String icon, final Thread thread) {
    this.max = max;

    // frame
    loading = new JWindow();

    // contain icon & all
    final JPanel info = new JPanel(new BorderLayout());
    // contain bar & label
    final JPanel content = new JPanel(new BorderLayout());
View Full Code Here

  /** This demonstrates how to customize a small <code>ColorPicker</code> component.
   */
  public static void main(String[] args) {
   
    final JFrame demo = new JFrame("Demo");
    final JWindow palette = new JWindow(demo);
    final ColorPicker picker = new ColorPicker(true,false);
   
    final JComboBox comboBox = new JComboBox();
    final JCheckBox alphaCheckbox = new JCheckBox("Include Alpha");
    final JCheckBox hsbCheckbox = new JCheckBox("Include HSB Values");
    final JCheckBox rgbCheckbox = new JCheckBox("Include RGB Values");
    final JCheckBox modeCheckbox = new JCheckBox("Include Mode Controls",true);
    final JButton button = new JButton("Show Dialog");
   
    demo.getContentPane().setLayout(new GridBagLayout());
    palette.getContentPane().setLayout(new GridBagLayout());
   
    GridBagConstraints c = new GridBagConstraints();
    c.gridx = 0; c.gridy = 0; c.weightx = 1; c.weighty = 0;
    c.insets = new Insets(5,5,5,5); c.anchor = GridBagConstraints.WEST;
    palette.getContentPane().add(comboBox,c);
    c.gridy++;
    palette.getContentPane().add(alphaCheckbox,c);
    c.gridy++;
    palette.getContentPane().add(hsbCheckbox,c);
    c.gridy++;
    palette.getContentPane().add(rgbCheckbox,c);
    c.gridy++;
    palette.getContentPane().add(modeCheckbox,c);
   
    c.gridy = 0;
    c.weighty = 1; c.fill = GridBagConstraints.BOTH;
    picker.setPreferredSize(new Dimension(220,200));
    demo.getContentPane().add(picker,c);
    c.gridy++; c.weighty = 0;
    demo.getContentPane().add(picker.getExpertControls(),c);
    c.gridy++; c.fill = GridBagConstraints.NONE;
    demo.getContentPane().add(button,c);
   
    comboBox.addItem("Hue");
    comboBox.addItem("Saturation");
    comboBox.addItem("Brightness");
    comboBox.addItem("Red");
    comboBox.addItem("Green");
    comboBox.addItem("Blue");
   
    ActionListener checkboxListener = new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        Object src = e.getSource();
        if(src==alphaCheckbox) {
          picker.setOpacityVisible(alphaCheckbox.isSelected());
        } else if(src==hsbCheckbox) {
          picker.setHSBControlsVisible(hsbCheckbox.isSelected());
        } else if(src==rgbCheckbox) {
          picker.setRGBControlsVisible(rgbCheckbox.isSelected());
        } else if(src==modeCheckbox) {
          picker.setModeControlsVisible(modeCheckbox.isSelected());
        }
        demo.pack();
      }
    };
    picker.setOpacityVisible(false);
    picker.setHSBControlsVisible(false);
    picker.setRGBControlsVisible(false);
    picker.setHexControlsVisible(false);
    picker.setPreviewSwatchVisible(false);
   
    picker.addPropertyChangeListener(ColorPicker.MODE_PROPERTY, new PropertyChangeListener() {
      public void propertyChange(PropertyChangeEvent evt) {
        int m = picker.getMode();
        if(m==ColorPicker.HUE) {
          comboBox.setSelectedIndex(0);
        } else if(m==ColorPicker.SAT) {
          comboBox.setSelectedIndex(1);
        } else if(m==ColorPicker.BRI) {
          comboBox.setSelectedIndex(2);
        } else if(m==ColorPicker.RED) {
          comboBox.setSelectedIndex(3);
        } else if(m==ColorPicker.GREEN) {
          comboBox.setSelectedIndex(4);
        } else if(m==ColorPicker.BLUE) {
          comboBox.setSelectedIndex(5);
        }
      }
    });
   
    alphaCheckbox.addActionListener(checkboxListener);
    hsbCheckbox.addActionListener(checkboxListener);
    rgbCheckbox.addActionListener(checkboxListener);
    modeCheckbox.addActionListener(checkboxListener);
    button.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        Color color = picker.getColor();
        color = ColorPicker.showDialog(demo, color, true);
        if(color!=null)
          picker.setColor(color);
      }
    });

    comboBox.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        int i = ((JComboBox)e.getSource()).getSelectedIndex();
        if(i==0) {
          picker.setMode(ColorPicker.HUE);
        } else if(i==1) {
          picker.setMode(ColorPicker.SAT);
        } else if(i==2) {
          picker.setMode(ColorPicker.BRI);
        } else if(i==3) {
          picker.setMode(ColorPicker.RED);
        } else if(i==4) {
          picker.setMode(ColorPicker.GREEN);
        } else if(i==5) {
          picker.setMode(ColorPicker.BLUE);
        }
      }
    });
    comboBox.setSelectedIndex(2);

    palette.pack();
    palette.setLocationRelativeTo(null);
   
    demo.addComponentListener(new ComponentAdapter() {
      public void componentMoved(ComponentEvent e) {
        Point p = demo.getLocation();
        palette.setLocation(new Point(p.x-palette.getWidth()-10,p.y));
      }
    });
    demo.pack();
    demo.setLocationRelativeTo(null);
    demo.setVisible(true);
    palette.setVisible(true);
   
    demo.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  }
View Full Code Here

          break;
        }

//        final boolean versionOK = this.checkVersion();

        this.cover = new JWindow(this.parent) {
            @Override
            public void paint(Graphics g) {
              if (style == XP) {
                Part part = null;
                switch (WindowButtonAdapter.this.type){
View Full Code Here

    splash.setVisible(false);
    splash.dispose();
  }

  public void init() {
    splash = new JWindow();
    splash.setSize(400, 300);

    splash.setLayout(new BorderLayout());

    loadLabel = new JLabel("Loading...");
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.