Package javax.swing

Examples of javax.swing.JOptionPane


         */
        public void displayError(String message) {
            if (debug) {
                System.err.println(message);
            }
            JOptionPane pane =
                new JOptionPane(message, JOptionPane.ERROR_MESSAGE);
            JDialog dialog = pane.createDialog(JSVGViewerFrame.this, "ERROR");
            dialog.setModal(false);
            dialog.show();
        }
View Full Code Here


         */
        public void displayError(String message) {
            if (svgUserAgent != null) {
                super.displayError(message);
            } else {
                JOptionPane pane =
                    new JOptionPane(message, JOptionPane.ERROR_MESSAGE);
                JDialog dialog =
                    pane.createDialog(JSVGCanvas.this, "ERROR");
                dialog.setModal(false);
                dialog.show(); // Safe to be called from any thread
            }
        }
View Full Code Here

         */
        public void displayError(String message) {
            if (debug) {
                System.err.println(message);
            }
            JOptionPane pane =
                new JOptionPane(message, JOptionPane.ERROR_MESSAGE);
            JDialog dialog = pane.createDialog(JSVGViewerFrame.this, "ERROR");
            dialog.setModal(false);
            dialog.show();
        }
View Full Code Here

  }
   
  public void testMethod1(TestHarness harness)
  {
    harness.checkPoint("()");
    JOptionPane p = new MyJOptionPane();
    InputMap m1 = p.getInputMap();
    InputMap m2 = p.getInputMap(JComponent.WHEN_FOCUSED);  
    harness.check(m1 == m2);
  }
View Full Code Here

  }
   
  public void testMethod2(TestHarness harness)
  {
    harness.checkPoint("(int)");
    JOptionPane p = new MyJOptionPane();
    InputMap m1 = p.getInputMap(JComponent.WHEN_FOCUSED);
    harness.check(m1.keys(), null);
    InputMap m1p = m1.getParent();
    harness.check(m1p, null);
    InputMap m2 = p.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);  
    harness.check(m2.keys(), null);
    harness.check(m2.getParent(), null);
    InputMap m3 = p.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
    harness.check(m3.keys(), null);
    InputMap m3p = m3.getParent();
    harness.check(m3p.get(KeyStroke.getKeyStroke("pressed ESCAPE")), "close");
  }
View Full Code Here

         */
        public void displayError(String message) {
            if (svgUserAgent != null) {
                super.displayError(message);
            } else {
                JOptionPane pane =
                    new JOptionPane(message, JOptionPane.ERROR_MESSAGE);
                JDialog dialog =
                    pane.createDialog(JSVGCanvas.this, "ERROR");
                dialog.setModal(false);
                dialog.show(); // Safe to be called from any thread
            }
        }
View Full Code Here

         */
        public void displayError(String message) {
            if (debug) {
                System.err.println(message);
            }
            JOptionPane pane =
                new JOptionPane(message, JOptionPane.ERROR_MESSAGE);
            JDialog dialog = pane.createDialog(JSVGViewerFrame.this, "ERROR");
            dialog.setModal(false);
            dialog.show();
        }
View Full Code Here

    private void initUI(String message, String prompt, boolean initialState,
        int type) {

        this.panel = new JPanel();
        JOptionPane optionPane = new JOptionPane(message, type, 0, null,
            new Object[0], null)
            {
                public int getMaxCharactersPerLineCount() {
                    return 100;
                }
            };
        optionPane.setUI(new javax.swing.plaf.basic.BasicOptionPaneUI() {
            public Dimension getMinimumOptionPaneSize() {
                if (minimumSize == null) {
                    return new Dimension(MinimumWidth, 50);
                }
                return new Dimension(minimumSize.width, 50);
            }
        });
        optionPane.setWantsInput(false);
       
        JPanel checkPanel = new JPanel();
        checkbox = new JCheckBox(prompt, initialState);
        checkPanel.setLayout(new BorderLayout());
        checkPanel.setBorder(new EmptyBorder(0, 20, 0, 0));
View Full Code Here

    }
    else
    {
      if (stepMode)
      {
        JOptionPane optionPane = new JOptionPane();
        optionPane.showMessageDialog(this, msg, "TestTool Notification", JOptionPane.INFORMATION_MESSAGE);
      }
      else
      {
        Object[] options = { "OK", "Go back to step mode" };
        if (1 == JOptionPane.showOptionDialog(this, msg, "TestTool Notification",
View Full Code Here

//                //Performatives r = ( Performatives ) p ;
//        }
//    }

    public void handleRequestGive() {
        final JOptionPane pane = new JOptionPane( "xxx msg" );
        pane.setWantsInput( true );

        pane.setInputValue( "" );
        pane.setOptions( new String[]{"Yes", "No"} );

        JInternalFrame internalFrame = pane.createInternalFrame( contentPane,
                                                                 "xxx title" );
        internalFrame.setVisible( true );
        pane.show();
        internalFrame.addInternalFrameListener( new InternalFrameListener() {

            public void internalFrameOpened(InternalFrameEvent e) {
            }

            public void internalFrameIconified(InternalFrameEvent e) {
            }

            public void internalFrameDeiconified(InternalFrameEvent e) {
            }

            public void internalFrameDeactivated(InternalFrameEvent e) {
            }

            public void internalFrameClosing(InternalFrameEvent e) {

            }

            public void internalFrameClosed(InternalFrameEvent e) {
                System.out.println( pane.getInputValue() + ":" + pane.getValue() );
            }

            public void internalFrameActivated(InternalFrameEvent e) {
            }
        } );
View Full Code Here

TOP

Related Classes of javax.swing.JOptionPane

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.