Package javax.swing

Examples of javax.swing.JFrame.addComponentListener()


        scrollPane.setAlignmentY(Component.TOP_ALIGNMENT);

        // create the palette internal window
        JFrame paletteWindow = new JFrame(windowName);

        paletteWindow.addComponentListener(cl);
        paletteWindow.getContentPane().add(scrollPane);
        //layout all the components
        paletteWindow.pack();
        return paletteWindow;
    }
View Full Code Here


        pane.setLayout(new BoxLayout(pane, BoxLayout.Y_AXIS));
        pane.setAlignmentX(Component.CENTER_ALIGNMENT);
        pane.setAlignmentY(Component.BOTTOM_ALIGNMENT);
        pane.add(gui);
        JFrame paletteWindow = new JFrame(windowName);
        paletteWindow.addComponentListener(cl);
        paletteWindow.getContentPane().add(pane);
        paletteWindow.pack();

        return paletteWindow;
    }
View Full Code Here

    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));
      }
    });
View Full Code Here

    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));
      }
    });
View Full Code Here

    comboBox.setSelectedIndex(2);

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

    final JFrame          f  = new JFrame( "Test" );
    final JLabel          lb  = new JLabel( "", SwingConstants.CENTER );
    final Rectangle          r  = new Rectangle();
    final ComponentBoundsRestrictor  cbr = new ComponentBoundsRestrictor();
    f.getContentPane().add( lb );
    f.addComponentListener( new ComponentAdapter() {
      private void update()
      {
        f.getBounds( r );
        lb.setText( "L " + r.x + ", T " + r.y + ", R " + (r.x + r.width) +
                    ", B " + (r.y + r.height) + ", W " + r.width +
View Full Code Here

                    Logger.getLogger(MainView.class.getName()).log(Level.SEVERE, null, ex);
                    System.exit(1);
                }
            }
        });
        frame.addComponentListener(new java.awt.event.ComponentAdapter() {

            @Override
            public void componentResized(java.awt.event.ComponentEvent evt) {
                int width = evt.getComponent().getWidth();
                int height = evt.getComponent().getHeight();
View Full Code Here

    frame.getContentPane().setLayout(new BorderLayout());

    CruiseControlApplication.setWindowSize(frame);

    frame.addComponentListener(new ComponentAdapter() {
      public void componentResized(ComponentEvent component) {
        JFrame frame = (JFrame) component.getComponent();

        int width = frame.getWidth();
        int height = frame.getHeight();
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.