Package java.awt

Examples of java.awt.Label$AccessibleAWTLabel


            });
        }

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


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

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

        gbc.insets = new Insets(2, 2, 2, 2);

        // Realm
        if (authenticator instanceof BasicAuthentication) {
            gbc.weightx = 0.0;
            UIUtil.gridBagAdd(p, new Label(Messages.getString("AuthenticationDialog.realm")), gbc, GridBagConstraints.RELATIVE); //$NON-NLS-1$
            gbc.weightx = 1.0;
            UIUtil.gridBagAdd(p, new Label(((BasicAuthentication) authenticator).getRealm()), gbc, GridBagConstraints.REMAINDER);
        }

        // Realm
        TextField domain = null;
        if (authenticator instanceof NTLMAuthentication) {
            gbc.weightx = 0.0;
            UIUtil.gridBagAdd(p, new Label(Messages.getString("AuthenticationDialog.domain")), gbc, GridBagConstraints.RELATIVE); //$NON-NLS-1$
            domain = new TextField("", 15); //$NON-NLS-1$
            gbc.weightx = 1.0;
            UIUtil.gridBagAdd(p, domain, gbc, GridBagConstraints.REMAINDER);
        }

        // Username
        gbc.weightx = 0.0;
        UIUtil.gridBagAdd(p, new Label(Messages.getString("AuthenticationDialog.username")), gbc, GridBagConstraints.RELATIVE); //$NON-NLS-1$
        final TextField username = new TextField("", 15); //$NON-NLS-1$
        gbc.weightx = 1.0;
        UIUtil.gridBagAdd(p, username, gbc, GridBagConstraints.REMAINDER);
        username.requestFocus();

        // Password
        gbc.weightx = 0.0;
        UIUtil.gridBagAdd(p, new Label(Messages.getString("AuthenticationDialog.password")), gbc, GridBagConstraints.RELATIVE); //$NON-NLS-1$
        final TextField password = new TextField("", 15); //$NON-NLS-1$
        gbc.weightx = 1.0;
        UIUtil.gridBagAdd(p, password, gbc, GridBagConstraints.REMAINDER);
        password.requestFocus();
        password.setEchoChar('*');
 
View Full Code Here

    while (tok.hasMoreTokens()) {
      String t = tok.nextToken();
//      if (!tok.hasMoreTokens()) {
//        constraints.weighty = 1.0;
//      }
      Label l = new Label(t);
      UIUtil.gridBagAdd(this, l, constraints,
          GridBagConstraints.REMAINDER);
    }
    validate();
    repaint();
View Full Code Here

  //  Debug
  public static void main(String[] args) {
    Frame frame = new Frame("Tabs"); //$NON-NLS-1$
    frame.setLayout(new BorderLayout());

    Label l1 = new Label("Test label 1"); //$NON-NLS-1$
    Panel p1 = new Panel(new BorderLayout());
    p1.add(l1, BorderLayout.CENTER);

    Label l2 = new Label("Test label 2"); //$NON-NLS-1$
    Panel p2 = new Panel(new BorderLayout());
    p2.add(l2, BorderLayout.CENTER);

    Label l3 = new Label("Test label 3"); //$NON-NLS-1$
    Panel p3 = new Panel(new BorderLayout());
    p3.add(l3, BorderLayout.CENTER);

    Label l4 = new Label("Test label 4"); //$NON-NLS-1$
    Panel p4 = new Panel(new BorderLayout());
    p4.add(l4, BorderLayout.CENTER);

    TabbedPanel tabs = new TabbedPanel(TabbedPanel.TOP);
    tabs.add("Test Tab 1", p1); //$NON-NLS-1$
View Full Code Here

      p.setBackground(backgroundColor);
      p.setForeground(foregroundColor);
      GridBagConstraints gbc = new GridBagConstraints();
      gbc.anchor = GridBagConstraints.CENTER;

      Label tl = new Label(title);
      tl.setFont(titleFont);
      UIUtil.gridBagAdd(p, tl, gbc, GridBagConstraints.REMAINDER);

      WrappingLabel l = new WrappingLabel();
      l.setText(message);
      l.setVAlignStyle(Canvas.TOP_ALIGNMENT);
      l.setBackground(backgroundColor);
      l.setForeground(foregroundColor);
      gbc.fill = GridBagConstraints.BOTH;
      gbc.weighty = 1.0;
      l.setFont(textFont);
      l.setHAlignStyle(textAlign);
      gbc.weightx = 1.0;
      if (image != null) {
        Panel pi = new Panel(new BorderLayout(4, 0));
        pi.setBackground(backgroundColor);
        pi.setForeground(foregroundColor);
        UIUtil.waitFor(image, this);
        ImageCanvas c = new ImageCanvas(image);
        c.setValign(Canvas.TOP_ALIGNMENT);
        pi.add(c, BorderLayout.WEST);
        pi.add(l, BorderLayout.CENTER);
        UIUtil.gridBagAdd(p, pi, gbc, GridBagConstraints.REMAINDER);
      } else {
        UIUtil.gridBagAdd(p, l, gbc, GridBagConstraints.REMAINDER);
      }

      p.addMouseListener(this);
      l.addMouseListener(this);
      tl.addMouseListener(this);

      add(p);

      if (timeout > 0) {
        Thread t = new Thread() {
          public void run() {
            try {
              Thread.sleep(timeout);
            } catch (InterruptedException ie) {
            }
            hideAndRemove(MessageWindow.this);
          }
        };
        t.start();
      }
     
      if(actionText != null) {
        Label l2 = new Label(actionText);
        l2.setAlignment(Label.CENTER);
        l2.setFont(new Font(titleFont.getName(), Font.PLAIN, 10));
        gbc.anchor = GridBagConstraints.CENTER;
        gbc.weightx = 1.0;
        UIUtil.gridBagAdd(p, l2, gbc, GridBagConstraints.REMAINDER);
      }
    }
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));
View Full Code Here

        path.addActionListener(this);
        gbc1.fill = GridBagConstraints.HORIZONTAL;
        gbc1.anchor = GridBagConstraints.WEST;
        gbc1.weightx = 0.0;
        gbc1.insets = new Insets(2, 2, 2, 2);
        UIUtil.gridBagAdd(pathPanel, new Label(Messages.getString("AWTFileSelector.fileName")), gbc1, showButtons ? 1 : GridBagConstraints.RELATIVE); //$NON-NLS-1$
        gbc1.weightx = 1.0;
        UIUtil.gridBagAdd(pathPanel, path, gbc1, showButtons ? GridBagConstraints.RELATIVE : GridBagConstraints.REMAINDER);
        gbc1.weightx = 0.0;
        if(showButtons) {
            go = new ImageButton(null, Messages.getString("AWTFileSelector.go"), "go"); //$NON-NLS-1$ //$NON-NLS-2$
            go.setHoverButton(true);
            go.addActionListener(this);
            go.setToolTipText(Messages.getString("AWTFileSelector.navigateToSelectedFolder")); //$NON-NLS-1$
            UIUtil.gridBagAdd(pathPanel, go, gbc1, GridBagConstraints.REMAINDER);
        }
        UIUtil.gridBagAdd(pathPanel, new Label(Messages.getString("AWTFileSelector.filesOfType")), gbc1, showButtons ? 1 : GridBagConstraints.RELATIVE); //$NON-NLS-1$
        gbc1.weightx = 1.0;
        filterSelect = new Choice();
        rebuildFilterSelect();
        filterSelect.addItemListener(new ItemListener() {
            public void itemStateChanged(ItemEvent e) {
                refresh();
            }
        });
        UIUtil.gridBagAdd(pathPanel, filterSelect, gbc1, showButtons ? GridBagConstraints.RELATIVE : GridBagConstraints.REMAINDER);
        gbc1.weightx = 0.0;
        if(showButtons) {
            UIUtil.gridBagAdd(pathPanel, new Label(), gbc1, GridBagConstraints.REMAINDER);           
        }

        // Build the main component
        add(top, "North"); //$NON-NLS-1$
        add(files, "Center"); //$NON-NLS-1$
View Full Code Here

   * @param image image
   */
  public ImageLabel(String text, Image image) {
    super(NONE, new BorderLayout(2, 0));
    imageCanvas = new ImageCanvas();
    textLabel = new Label() {
      public Dimension getMinimumSize() {
        return getPreferredSize();
      }

      public void processEvent(AWTEvent evt) {
View Full Code Here

TOP

Related Classes of java.awt.Label$AccessibleAWTLabel

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.