Package charvax.swing.border

Examples of charvax.swing.border.EmptyBorder


      _ownerComponent = owner_;
      setLayout(new BorderLayout());

      JPanel northpan = new JPanel();
      northpan.setBorder(new EmptyBorder(2,2,1,2));

      JPanel messagepanel = new JPanel();
      if (message_ instanceof String) {
    messagepanel.add(new JLabel((String) message_));
      }
      else if (message_ instanceof Object[]) {
    messagepanel.setLayout(
      new BoxLayout(getOwner(), BoxLayout.Y_AXIS));

    Object[] objects = (Object[]) message_;
    for (int i=0; i<objects.length; i++) {
        messagepanel.add(new JLabel(objects[i].toString()));
    }
      }
      else {
    throw new IllegalArgumentException("illegal message type " +
           message_.getClass().getName());
      }

      northpan.add(messagepanel);
      add(northpan, BorderLayout.NORTH);

      if (_wantsInput) {
    JPanel centerpan = new JPanel();
    centerpan.setBorder(new EmptyBorder(1, 1, 1, 1));
    _inputField = new JTextField(_inputValue, 20);
    _inputField.addActionListener(this);
    centerpan.add(_inputField);
    add(centerpan, BorderLayout.CENTER);
      }
View Full Code Here


      add(_scrollPane, BorderLayout.WEST);

      /* Insert a north panel that contains the Parent and New buttons.
       */
      JPanel toppanel = new JPanel();
      toppanel.setBorder(new EmptyBorder(0,1,0,1));
      toppanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 1, 0));
      toppanel.add(_parentButton);
      _parentButton.setText(PARENT_DIRECTORY_LABEL);
      _parentButton.addActionListener(this);

      toppanel.add(_newButton);
      _newButton.setText(NEW_DIRECTORY_LABEL);
      _newButton.addActionListener(this);
      add(toppanel, BorderLayout.NORTH);

      /* Insert a panel in the south for the textfield and the
       * Approve and Cancel buttons.
       */
      JPanel southpanel = new JPanel();
      southpanel.setLayout(new BorderLayout());

      JPanel topsouth = new JPanel();
      topsouth.add(new JLabel("Pathname:"));
      topsouth.add(_locationField);
      _locationField.setText(_location);
      _locationField.setActionCommand("locationField");
      _locationField.addActionListener(this);
      southpanel.add(topsouth, BorderLayout.NORTH);

      JPanel bottomsouth = new JPanel();
      bottomsouth.setLayout(new FlowLayout(FlowLayout.RIGHT, 1, 0));
      bottomsouth.setBorder(new EmptyBorder(1,1,0,1));
      bottomsouth.add(_approveButton);
      bottomsouth.add(_cancelButton);
      _approveButton.setText(_approveButtonText);
      _cancelButton.setText(CANCEL_LABEL);
      _approveButton.addActionListener(this);
View Full Code Here

      setTitle("Enter the new directory name");
      _parentFile = parent_;
      setSize(60, 10);

      JPanel midpan = new JPanel();
      midpan.setBorder(new EmptyBorder(2,2,2,2));
      midpan.add(new JLabel("Directory name:"));
      _dirnameField = new JTextField(35);
      _dirnameField.setActionCommand("dirname");
      _dirnameField.addActionListener(this);
      midpan.add(_dirnameField);
View Full Code Here

            _visibleCb.addItemListener(this);
            northpan.add(_visibleCb);

            JPanel southpan = new JPanel();
            _textfield = new JTextField("This is some text.....");
            _textfield.setBorder(new EmptyBorder(1, 1, 1, 1));
            southpan.add(_textfield);

            add(northpan, BorderLayout.NORTH);
            add(southpan, BorderLayout.SOUTH);
        }
View Full Code Here

            _visibleCb.addItemListener(this);
            northpan.add(_visibleCb);

            JPanel southpan = new JPanel();
            _textfield = new JPasswordField("This is some text.....");
            _textfield.setBorder(new EmptyBorder(1, 1, 1, 1));
            southpan.add(_textfield);

            add(northpan, BorderLayout.NORTH);
            add(southpan, BorderLayout.SOUTH);
        }
View Full Code Here

        JPanel northpan = new JPanel();
        northpan.setBorder(new TitledBorder("A floating-point input field"));
        northpan.setLayout(new BorderLayout());

        JLabel label1 = new JLabel("Enter a non-numeric value, and then");
        label1.setBorder(new EmptyBorder(1, 1, 0, 1));
        northpan.add(label1, BorderLayout.NORTH);

        JLabel label2 = new JLabel("try pressing TAB");
        label2.setBorder(new EmptyBorder(0, 1, 1, 1));
        northpan.add(label2, BorderLayout.CENTER);

        northpan.add(_floatField, BorderLayout.SOUTH);
        _floatField.addFocusListener(this);
View Full Code Here

        super(owner_, "JTabbedPane Test");
        _insets = new Insets(2, 3, 2, 3);
        Container contentPane = getContentPane();

        JPanel toppan = new JPanel();
        toppan.setBorder(new EmptyBorder(1, 1, 1, 1));
        toppan.add(new JLabel(
                "Press the F5, F6 and F7 keys to switch between panes"));

        JPanel centerpan = new JPanel();
        centerpan.setLayout(new FlowLayout(FlowLayout.LEFT, 2, 1));
View Full Code Here

        JPanel panel = new JPanel();
        panel.add(new JLabel("Selected flavor: "));
        panel.add(_selectedFlavor);
        _selectedFlavor.setEnabled(false);
        panel.setBorder(new EmptyBorder(1, 1, 1, 1));
        northpan.add(panel);

        _buttons.add(_strawberry);
        _strawberry.setSelected(true); // select one button in the group
        _buttons.add(_chocolate);
View Full Code Here

        super(owner_, "JTable in a JScrollPane");
        _insets = new Insets(3, 3, 3, 3);
        Container contentPane = getContentPane();

        JPanel northpan = new JPanel();
        northpan.setBorder(new EmptyBorder(1, 1, 1, 1));
        northpan.add(new JLabel("Press ENTER to select/deselect columns/rows"));
        contentPane.add(northpan, BorderLayout.NORTH);

        contentPane.add(makeCenterPanel(), BorderLayout.CENTER);
View Full Code Here

                "A Text Field that converts to uppercase"));
        centerpan.setLayout(new BorderLayout());

        JLabel label1 = new JLabel(
                "The CapsTextField is a subclass of JTextField");
        label1.setBorder(new EmptyBorder(1, 1, 0, 1));
        centerpan.add(label1, BorderLayout.NORTH);

        JLabel label2 = new JLabel(
                "that overrides the processKeyEvent() method");
        label2.setBorder(new EmptyBorder(0, 1, 1, 1));
        centerpan.add(label2, BorderLayout.CENTER);

        JPanel southpan = new JPanel();
        southpan.add(new JLabel("CapsTextField: "));
        _capsField = new CapsTextField(
View Full Code Here

TOP

Related Classes of charvax.swing.border.EmptyBorder

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.