Package java.awt

Examples of java.awt.Dialog


//            assert !ProjectManager.getDefault().isModified(project) :
//                "Some of the customizer panels has written the changed data before OK Button was pressed. Please file it as bug."; //NOI18N
            uiProperties.save();
           
            // Close & dispose the the dialog
            Dialog dialog = (Dialog)project2Dialog.get( project );
            if ( dialog != null ) {
                dialog.setVisible(false);
                dialog.dispose();
            }
        }       
View Full Code Here


        }   
       
        public void windowClosing (WindowEvent e) {
            //Dispose the dialog otherwsie the {@link WindowAdapter#windowClosed}
            //may not be called
            Dialog dialog = (Dialog)project2Dialog.get( project );
            if ( dialog != null ) {
                dialog.setVisible(false);
                dialog.dispose();
            }
        }
View Full Code Here

                options[0],
                DialogDescriptor.BOTTOM_ALIGN,
                null,
                null);
            //desc.setMessageType (DialogDescriptor.INFORMATION_MESSAGE);
            Dialog dlg = DialogDisplayer.getDefault ().createDialog (desc);
            dlg.setVisible (true);
            if (desc.getValue() == options[0]) {
               mainClassTextField.setText (panel.getSelectedMainClass ());
            }
            dlg.dispose();
        }
View Full Code Here

            wb.setLabel("Hello World!");
            wb.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    l.setText("Hello World!");

                    final Dialog d = new Dialog(parent);
                    d.setLayout(new FlowLayout());
                    d.setModal(true);
                    Button b = new Button("foobar");
                    b.addMouseListener(new MouseAdapter() {
                        public void mousePressed(MouseEvent me) {
                            d.setVisible(false);
                        }
                    });
                    d.add(b);

                    List ch = new List();
                    ch.add("Ding");
                    ch.add("September");
                    ch.add("Red");
                    ch.add("Quassia");
                    ch.add("Pterodactyl");
                    d.add(ch);

                    d.pack();
                    d.setVisible(true);
                }
            });

            wb.addMouseListener(new MouseAdapter() {
                public void mousePressed(MouseEvent e) {
View Full Code Here

   *
   * @param harness  the test harness (<code>null</code> not permitted).
   */
  public void test(TestHarness harness)     
  {
    Dialog jd = new Dialog(new Frame());
    jd.show();
    jd.add(new Label("Hello world"));

    // jd insets may be larger than preferred size
    Dimension pref = jd.getPreferredSize();
    Dimension size = jd.getSize();
    System.err.println("size: " + size);
    System.err.println("pref: " + pref);
    harness.check(size.width >= pref.width);
    harness.check(size.height >= pref.height);
  }
View Full Code Here

  public void test(TestHarness harness)
  {
    // This test ensures that all properties are set
    // to the default values.
    Dialog dialog = new Dialog(new Frame());
    harness.check(dialog.getAlignmentX(), 0.5);
    harness.check(dialog.getAlignmentY(), 0.5);
    harness.check(dialog.getComponentCount(), 0);
    harness.check(dialog.getFocusableWindowState(), true);
    harness.check(dialog.getFocusTraversalKeysEnabled(), true);
    harness.check(dialog.getHeight(), 0);
    harness.check(dialog.getIgnoreRepaint(), false);
    harness.check(dialog.getWidth(), 0);
    harness.check(dialog.getX(), 0);
    harness.check(dialog.getY(), 0);
    harness.check(dialog.getBackground(), null);
    harness.check(dialog.getBounds(), new Rectangle());
    harness.check(dialog.getDropTarget(), null);
    harness.check(dialog.getFocusCycleRootAncestor(), null);
    harness.check(dialog.getFocusOwner(), null);
    harness.check(dialog.getFont(), null);
    harness.check(dialog.getForeground(), null);
    harness.check(dialog.getGraphics(), null);
    harness.check(dialog.getInputMethodRequests(), null);
    harness.check(dialog.getInsets(), new Insets(0, 0, 0, 0));
    harness.check(dialog.getLayout().toString(),
                      "java.awt.BorderLayout[hgap=0,vgap=0]");
    harness.check(dialog.getLocation(), new Point());
    harness.check(dialog.getMaximumSize(),
                       new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
    harness.check(dialog.getMinimumSize(), new Dimension());
    harness.check(dialog.getName(), "dialog0");
    harness.check(dialog.getPreferredSize(), new Dimension());
    harness.check(dialog.getSize(), new Dimension());
    harness.check(dialog.getTitle(), "");
    harness.check(dialog.getWarningString(), null);
   
    harness.check(dialog.isActive(), false);
    harness.check(dialog.isAlwaysOnTop(), false);
    harness.check(dialog.isBackgroundSet(), false);
    harness.check(dialog.isCursorSet(), true);
    harness.check(dialog.isDisplayable(), false);
    harness.check(dialog.isDoubleBuffered(), false);
    harness.check(dialog.isEnabled(), true);
    harness.check(dialog.isFocusable(), true);
    harness.check(dialog.isFocusableWindow(), true);
    harness.check(dialog.isFocusCycleRoot(), true);
    harness.check(dialog.isFocused(), false);
    harness.check(dialog.isFocusOwner(), false);
    harness.check(dialog.isFocusTraversalPolicyProvider(), false);
    harness.check(dialog.isFocusTraversalPolicySet(), true);
    harness.check(dialog.isFontSet(), false);
    harness.check(dialog.isForegroundSet(), false);
    harness.check(dialog.isLightweight(), false);
    harness.check(dialog.isMaximumSizeSet(), false);
    harness.check(dialog.isMinimumSizeSet(), false);
    harness.check(dialog.isModal(), false);
    harness.check(dialog.isOpaque(), false); // Currently fails on Classpath
    harness.check(dialog.isPreferredSizeSet(), false);
    harness.check(dialog.isResizable(), true);
    harness.check(dialog.isShowing(), false);
    harness.check(dialog.isUndecorated(), false);
    harness.check(dialog.isValid(), false);
    harness.check(dialog.isVisible(), false);
  }
View Full Code Here

            public void run() {
                assert modalDialogs != null;
               
                int size = modalDialogs.size();
                if (size > 0) {
                    final Dialog awtDialog = (Dialog)modalDialogs.get(size - 1);
                    Component focusOwner = awtDialog.getMostRecentFocusOwner();
                    if (verboseModalityHandling) {
                        System.err.println("Bringing to front, focusOwner=" + focusOwner);
                    }

                    if (focusOwner == null) {
                        focusOwner = awtDialog; // try the dialog itself in this case
                    }
                    try {
                        // In one case, a call to requestFocus() alone does not
                        // bring the AWT dialog to the top. This happens if the
                        // dialog is given a null parent frame. When opened, the dialog
                        // can be hidden by the SWT window even when it obtains focus.
                        // Calling toFront() solves the problem.
                        focusOwner.requestFocus();
                        awtDialog.toFront();
                    } catch (NullPointerException e) {
                        // Some dialogs (e.g. Windows page setup and print dialogs on JDK 1.5+) throw an NPE on
                        // requestFocus(). There's no way to check ahead of time, so just swallow the NPE here.
                    }
                }
View Full Code Here

        assert EventQueue.isDispatchThread();    // On AWT event thread
       
        // System-based close
        Window window = event.getWindow();
        if (window instanceof Dialog) {
            final Dialog dialog = (Dialog) window;
            // Defer until later. Bad things happen if
            // handleRemovedDialog() is called directly from
            // this event handler. The Swing dialog does not close
            // properly and its modality remains in effect.
            EventQueue.invokeLater(new Runnable() {
View Full Code Here

        MechView mechView = new MechView(entity, client.game.getOptions().booleanOption("show_bay_detail"));
        TextArea ta = new TextArea();
        ta.setEditable(false);
        ta.setFont(new Font("Monospaced", Font.PLAIN, 12)); //$NON-NLS-1$
        ta.setText(mechView.getMechReadout());
        final Dialog dialog = new Dialog(clientgui.frame, Messages
                .getString("ChatLounge.quickView"), false); //$NON-NLS-1$
        Button btn = new Button(Messages.getString("Okay")); //$NON-NLS-1$
        dialog.add("South", btn); //$NON-NLS-1$
        btn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(ActionEvent e) {
                dialog.setVisible(false);
            }
        });
        dialog.addWindowListener(new java.awt.event.WindowAdapter() {
            @Override
            public void windowClosing(WindowEvent e) {
                dialog.setVisible(false);
            }
        });
        dialog.add("Center", ta); //$NON-NLS-1$

        // Preview image of the Mech...
        BufferedPanel panPreview = new BufferedPanel();
        panPreview.setPreferredSize(84, 72);
        clientgui.loadPreviewImage(panPreview, entity);
        dialog.add("North", panPreview); //$NON-NLS-1$

        dialog.setLocation(clientgui.frame.getLocation().x
                + clientgui.frame.getSize().width / 2 - dialog.getSize().width
                / 2, clientgui.frame.getLocation().y
                + clientgui.frame.getSize().height / 5
                - dialog.getSize().height / 2);
        dialog.setSize(300, 450);

        dialog.validate();
        dialog.setVisible(true);
    }
View Full Code Here

        bv.addDisplayable(uo);

        Dimension screenSize = frame.getToolkit().getScreenSize();
        int x, y, h, w;

        mechW = new Dialog(frame,
                Messages.getString("ClientGUI.MechDisplay"), false); //$NON-NLS-1$
        x = GUIPreferences.getInstance().getDisplayPosX();
        y = GUIPreferences.getInstance().getDisplayPosY();
        h = GUIPreferences.getInstance().getDisplaySizeHeight();
        w = GUIPreferences.getInstance().getDisplaySizeWidth();
        if (x + w > screenSize.width) {
            x = 0;
            w = Math.min(w, screenSize.width);
        }
        if (y + h > screenSize.height) {
            y = 0;
            h = Math.min(h, screenSize.height);
        }
        mechW.setLocation(x, y);
        mechW.setSize(w, h);
        mechW.setResizable(true);
        mechW.addWindowListener(this);
        mechD = new MechDisplay(this);
        mechD.addMechDisplayListener(bv);
        mechW.add(mechD);

        // added by kenn
        Ruler.color1 = GUIPreferences.getInstance().getRulerColor1();
        Ruler.color2 = GUIPreferences.getInstance().getRulerColor2();
        ruler = new Ruler(frame, client, bv);
        x = GUIPreferences.getInstance().getRulerPosX();
        y = GUIPreferences.getInstance().getRulerPosY();
        h = GUIPreferences.getInstance().getRulerSizeHeight();
        w = GUIPreferences.getInstance().getRulerSizeWidth();
        if (x + w > screenSize.width) {
            x = 0;
            w = Math.min(w, screenSize.width);
        }
        if (y + h > screenSize.height) {
            y = 0;
            h = Math.min(h, screenSize.height);
        }
        ruler.setLocation(x, y);
        ruler.setSize(w, h);
        // end kenn

        // minimap
        minimapW = new Dialog(frame,
                Messages.getString("ClientGUI.MiniMap"), false); //$NON-NLS-1$
        x = GUIPreferences.getInstance().getMinimapPosX();
        y = GUIPreferences.getInstance().getMinimapPosY();
        try {
            minimap = new MiniMap(minimapW, this, bv);
View Full Code Here

TOP

Related Classes of java.awt.Dialog

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.