Package java.awt

Examples of java.awt.Panel$AccessibleAWTPanel


    //Preparing parameters
    Image image =
      Toolkit.getDefaultToolkit().createImage(
        JRLoader.loadBytesFromLocation("dukesign.jpg")
        );
    MediaTracker traker = new MediaTracker(new Panel());
    traker.addImage(image, 0);
    try
    {
      traker.waitForID(0);
    }
View Full Code Here


    //Preparing parameters
    Image image =
      Toolkit.getDefaultToolkit().createImage(
        JRLoader.loadBytesFromLocation("dukesign.jpg")
        );
    MediaTracker traker = new MediaTracker(new Panel());
    traker.addImage(image, 0);
    try
    {
      traker.waitForID(0);
    }
View Full Code Here

  public void run() throws JRException
  {
    long start = System.currentTimeMillis();
    //Preparing parameters
    Image image = Toolkit.getDefaultToolkit().createImage("dukesign.jpg");
    MediaTracker traker = new MediaTracker(new Panel());
    traker.addImage(image, 0);
    try
    {
      traker.waitForID(0);
    }
View Full Code Here

        if(img != null) {
            ImageCanvas ic = new ImageCanvas(UIUtil.waitFor(img, this));
            ic.setValign(ImageCanvas.CENTER_ALIGNMENT);
            add(ic, BorderLayout.WEST);
        }
        mainPanel = new Panel(new BorderLayout());
        add(mainPanel, BorderLayout.CENTER);

        if ("true".equals(getParameter("autoStart", "false"))) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
            mainPanel.add(new Label(Messages.getString("VPNLauncher.launching")), BorderLayout.CENTER); //$NON-NLS-1$
        } /*
 
View Full Code Here

                }
            });
        }

        // add the message to the top of the dialog
        Panel top = new Panel(new FlowLayout(FlowLayout.CENTER, 1, 1));
        mess = new Label(message);
        top.add(mess);
        pbar.add("North", top); //$NON-NLS-1$

        // add the progress bar to the middle of the dialog
        Panel middle = new Panel(new FlowLayout(FlowLayout.CENTER, 1, 1));
        pbox = new ProgressBox(maxValue);
        middle.add(pbox);
        pbar.add("Center", middle); //$NON-NLS-1$

        // add the Cancel button to the bottom of the dialog (if allowCancel is
        // true)
        if (allowCancel) {
            Panel bottom = new Panel(new FlowLayout(FlowLayout.CENTER, 1, 1));
            cancel = new Button(Messages.getString("ProgressBar.cancel")); //$NON-NLS-1$
            cancel.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    // pbar.dispose();
                    shouldCancel = true;
                }
            });
            bottom.add(cancel);
            pbar.add("South", bottom); //$NON-NLS-1$
        }

        // display the ProgressBar dialog
        Dimension d = pbar.getToolkit().getScreenSize();
View Full Code Here

    public OptionDialog(int type, Object text, Option choices[], OptionCallback callback, Component buttonBarAccessory) {
        super(new BorderLayout());
        lock_ = new Object();
        dismissed = false;
        this.callback = callback;
        Panel titlePanel = new Panel(new FlowLayout(0));
        Image icon = null;
        switch (type) {
        case 0:
            // '\0'
            icon = UIUtil.loadImage(getClass(), INFORMATION_ICON);
            break;
        case 2:
            // '\002'
            icon = UIUtil.loadImage(getClass(), WARNING_ICON);
            break;
        case 1:
            // '\001'
            icon = UIUtil.loadImage(getClass(), QUESTION_ICON);
            break;
        case 99:
            break;
        default:
            icon = UIUtil.loadImage(getClass(), ERROR_ICON);
            break;
        }
        if (icon != null) {
            UIUtil.waitFor(icon, this);
        }
        Panel textPanel = new Panel(new GridBagLayout());
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.anchor = GridBagConstraints.WEST;
        gbc.fill = GridBagConstraints.NONE;
        if (text instanceof Component) {
            UIUtil.gridBagAdd(textPanel, (Component) text, gbc, 0);
        } else {
            StringTokenizer st = new StringTokenizer(String.valueOf(text), "\n"); //$NON-NLS-1$
            while (st.hasMoreTokens()) {
                String n = st.nextToken().trim();
                if (n.length() > 0) {
                    UIUtil.gridBagAdd(textPanel, new Label(n), gbc, 0);
                }
            }
        }
        add(textPanel, "Center"); //$NON-NLS-1$
        Panel choicePanel = new Panel(new FlowLayout(buttonBarAccessory == null ? FlowLayout.CENTER : FlowLayout.RIGHT));
        OptionWrapper choice = new OptionWrapper();
        choice.idx = -1;
        for (int i = 0; choices != null && i < choices.length; i++) {
            //      ImageButton b = new ImageButton(choices[i].getIcon(), choices[i]
            //          .getText(), choices[i].getText());
            Button b = new Button(choices[i].getText()) {
                public Dimension getMinimumSize() {
                    return new Dimension(60, super.getMinimumSize().height);
                }

                public Dimension getPreferredSize() {
                    return getMinimumSize();
                }
            };
            choicePanel.add(b);
            b.addActionListener(new BlockingActionListener(choices[i]));
        }
        if (icon != null) {
            add(new ImageCanvas(icon), "West"); //$NON-NLS-1$
        }
        if(buttonBarAccessory != null) {
            Panel p= new Panel(new GridBagLayout());
            GridBagConstraints gbc2 = new GridBagConstraints();
            gbc2.anchor = GridBagConstraints.WEST;
            gbc2.fill = GridBagConstraints.HORIZONTAL;
            gbc2.insets = new Insets(2, 4, 2, 2);
            UIUtil.gridBagAdd(p, buttonBarAccessory, gbc2, GridBagConstraints.RELATIVE);
View Full Code Here

        return promptForText(parent, title, defaultText, accessory, echoCharacter, label, -1, "South"); //$NON-NLS-1$
    }

    public static String promptForText(Component parent, String title, String defaultText, Component accessory, char echoCharacter,
                    String label, int textWidth, String accesoryPosition) {
        Panel p = new Panel(new BorderLayout());
        Panel middle = new Panel(new FlowLayout());
        middle.add(new Label(label));
        TextField text = new TextField(defaultText, textWidth == -1 ? 15 : textWidth);
        middle.add(text);
        p.add(middle, "Center"); //$NON-NLS-1$
        if (echoCharacter != ' ')
            text.setEchoChar(echoCharacter);
        text.requestFocus();
        final OptionDialog dialog = new OptionDialog(QUESTION, p, CHOICES_OK_CANCEL, null);
View Full Code Here

            }
            textArea = new TextArea();
            textArea.setEditable(false);
            textArea.setBackground(Color.white);
            textArea.setForeground(Color.black);
            Panel panel = new Panel(new BorderLayout());
            panel.setBackground(Color.gray);
            panel.setForeground(Color.black);
            panel.add(textArea, BorderLayout.CENTER);
            Panel buttonPanel = new Panel(new FlowLayout(FlowLayout.RIGHT));
            buttonPanel.setBackground(Color.gray);
            buttonPanel.setForeground(Color.black);
            Button clear = new Button(Messages.getString("ConsoleOutputStream.actions.clear")); //$NON-NLS-1$
            clear.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent evt) {
                    clear();
                }
            });
            buttonPanel.add(clear);
            Button close = new Button(Messages.getString("ConsoleOutputStream.actions.close")); //$NON-NLS-1$
            close.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent evt) {
                    frame.setVisible(false);
                }
            });
            buttonPanel.add(close);
            panel.add(buttonPanel, BorderLayout.SOUTH);
            frame = new Frame(Messages.getString("ConsoleOutputStream.title")); //$NON-NLS-1$
            frame.addWindowListener(new WindowAdapter() {
                public void windowClosing(WindowEvent evt) {
                    frame.setVisible(false);
View Full Code Here

     *
     * @param authenticator authenticator
     * @return <code>falsE</code> if cancelled.
     */
    public static boolean promptForCredentials(boolean proxy, HttpAuthenticator authenticator) {
        Panel p = new Panel(new GridBagLayout());
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.anchor = GridBagConstraints.WEST;
        gbc.fill = GridBagConstraints.HORIZONTAL;
        gbc.insets = new Insets(2, 2, 2, 2);

View Full Code Here

                   }
               }
           }
        });
       
        Panel p = new Panel(new BorderLayout());
        p.add(portGrid, BorderLayout.CENTER);
       
        Panel f = new Panel(new FlowLayout(FlowLayout.RIGHT));
        f.setBackground(Color.gray);
        f.setForeground(Color.black);
        f.add(stopButton);
        f.add(closeButton);
       
        setLayout(new BorderLayout());
        add(p, BorderLayout.CENTER);
        add(f, BorderLayout.SOUTH);
        pack();
View Full Code Here

TOP

Related Classes of java.awt.Panel$AccessibleAWTPanel

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.