Package javax.swing

Examples of javax.swing.JWindow


    private JRadioButtonMenuItem largeItem;
    private JCheckBoxMenuItem sItem, nsItem, inItem, delItem;
   
    public Tipster() {
      super();
      toolTip = new JWindow();
      label = new JLabel();
      popupMenu = new JPopupMenu();
      smallItem = new JRadioButtonMenuItem(UICaption.popup_menuitem_plot_dot_small);
      mediumItem = new JRadioButtonMenuItem(UICaption.popup_menuitem_plot_dot_medium);
      largeItem = new JRadioButtonMenuItem(UICaption.popup_menuitem_plot_dot_large);
View Full Code Here


        size.width += 2;
        size.height += 2;
        display = new BufferedImage(size.width, size.height,
                                    BufferedImage.TYPE_INT_BGR);

        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

        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

                                    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

        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

   * @return javax.swing.JWindow 
   */
  @SuppressWarnings("unused")
  private JWindow getJWindow() {
    if (jWindow == null) {
      jWindow = new JWindow(this);
      jWindow.setContentPane(getJContentPane());
    }
    return jWindow;
  }
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

      return;
  }

  // if window is null create the window
  if (window == null) {
      window = new JWindow((Window)getTopMostContainer());
      jheditor = new JHelpContentViewer(getHelpModel());
      window.getRootPane().setBorder(BorderFactory.createLineBorder(Color.black, 2));

      window.getContentPane().add(jheditor, BorderLayout.CENTER);
  }
View Full Code Here

    if (m_previewWindow == null) {
     
      JLabel jl = new JLabel(m_subFlowPreview);
      //Dimension d = jl.getPreferredSize();
      jl.setLocation(0,0);
      m_previewWindow = new JWindow();
      //popup.getContentPane().setLayout(null);
      m_previewWindow.getContentPane().add(jl);
      m_previewWindow.validate();
      m_previewWindow.setSize(m_subFlowPreview.getIconWidth(), m_subFlowPreview.getIconHeight());
     
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.