Package javax.swing.border

Examples of javax.swing.border.EmptyBorder


    private void setUpControlComponent() {
        JLabel rateLabel = new JLabel("Rate:", JLabel.RIGHT);
        JPanel mainPanel = new JPanel();
        int GAP = 10;

        Border emptyBorder  = new EmptyBorder(GAP,GAP,GAP,GAP);

        Border etchedBorder = new CompoundBorder(
            new EtchedBorder(), emptyBorder);

        Border titledBorder = new TitledBorder(
View Full Code Here


        public FontSelectorDialog(Component comp, Font font) {

            //super(JOptionPane.getFrameForComponent(comp),jpicedt.Localizer.currentLocalizer().get("widget.FontSelector"),true); //
            super(JOptionPane.getFrameForComponent(comp),Globals.lang("FontSelector"),true); //
                JPanel content = new JPanel(new BorderLayout());
                content.setBorder(new EmptyBorder(12,12,12,12));
                setContentPane(content);

                JPanel listPanel = new JPanel(new GridLayout(1,3,6,6));

                JPanel familyPanel = createTextFieldAndListPanel(
                                                                 Globals.lang("Font Family"),
                                                                 familyField = new JTextField(),
                                                                 familyList = new JList(getFontList()));
                listPanel.add(familyPanel);

                String[] sizes = { "9", "10", "12", "14", "16", "18", "24" };
                JPanel sizePanel = createTextFieldAndListPanel(
                                                               Globals.lang("Font Size"),
                                       sizeField = new JTextField(),
                                       sizeList = new JList(sizes));
                listPanel.add(sizePanel);

                String[] styles = {PLAIN,BOLD,ITALIC,BOLD_ITALIC};

                JPanel stylePanel = createTextFieldAndListPanel(
                                                                Globals.lang("Font Style"),
                                        styleField = new JTextField(),
                                        styleList = new JList(styles));
                styleField.setEditable(false);
                listPanel.add(stylePanel);

                familyList.setSelectedValue(font.getFamily(),true);
                familyField.setText(font.getFamily());
                sizeList.setSelectedValue(String.valueOf(font.getSize()),true);
                sizeField.setText(String.valueOf(font.getSize()));
                styleList.setSelectedIndex(font.getStyle());
                styleField.setText((String)styleList.getSelectedValue());

                ListHandler listHandler = new ListHandler();
                familyList.addListSelectionListener(listHandler);
                sizeList.addListSelectionListener(listHandler);
                styleList.addListSelectionListener(listHandler);

                content.add(BorderLayout.NORTH,listPanel);

                //preview = new JLabel("Font Preview");

                /* --------------------------------------------------------
                   |  Experimental addition by Morten Alver. I want to    |
                   |  enable antialiasing in the preview field, since I'm |
                   |  working on introducing this in the table view.      |
                   -------------------------------------------------------- */
                preview = new JLabel(Globals.lang("Font Preview")) {
          private static final long serialVersionUID = -4191591634265068189L;
            public void paint(Graphics g) {
                            Graphics2D g2 = (Graphics2D)g;
                            g2.setRenderingHint
                                (RenderingHints.KEY_ANTIALIASING,
                                 RenderingHints.VALUE_ANTIALIAS_ON);
                            super.paint(g2);
                        }

                    };



                preview.setBorder(new TitledBorder(Globals.lang("Font Preview")));

                updatePreview();

                Dimension prefSize = preview.getPreferredSize();
                prefSize.height = 50;
                preview.setPreferredSize(prefSize);

                content.add(BorderLayout.CENTER,preview);

                JPanel buttons = new JPanel();
                buttons.setLayout(new BoxLayout(buttons,BoxLayout.X_AXIS));
                buttons.setBorder(new EmptyBorder(12,0,0,0));
                buttons.add(Box.createGlue());

                ok = new JButton(Globals.lang("OK"));
                ok.addActionListener(new ActionHandler());
                getRootPane().setDefaultButton(ok);
View Full Code Here

    setResizable(false);
    setTitle("About");
    setBounds(100, 100, 480, 263);
    getContentPane().setLayout(new BorderLayout());
    contentPanel.setLayout(new BorderLayout(0, 0));
    contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    getContentPane().add(contentPanel, BorderLayout.CENTER);
    {
      JTextArea systemInfo = new JTextArea("System info:\n");
      systemInfo.setEditable(false);
      systemInfo.setEnabled(true);
View Full Code Here

    /** Constructor. */
    public LocaleChooserPanel() {
        super();

        JPanel result = new JPanel(new BorderLayout());
        result.setBorder(new EmptyBorder(0, 5, 0, 5));
        TopPanel topPanel = new TopPanel(lang.getText("mpxLanguageSettings"),
                lang.getText("mpxLanguageSettingsComment"));
        topPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        result.add(topPanel, BorderLayout.NORTH);
        localePanel = new LocalePanel();
View Full Code Here

    public void setOptionKeyPrefix(String optionKeyPrefix) {
        myi18n.myOptionKeyPrefix = optionKeyPrefix;
    }
    public JComponent buildPage(GPOptionGroup[] optionGroups, String pageID) {
        JPanel result = new JPanel(new BorderLayout());
        result.setBorder(new EmptyBorder(0, 5, 0, 5));
        TopPanel topPanel = new TopPanel(myi18n.getPageTitle(pageID), myi18n
                .getPageDescription(pageID));
        topPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        result.add(topPanel, BorderLayout.NORTH);
        JComponent planePage = buildPlanePage(optionGroups);
View Full Code Here

    //Jp.setBackground(Color.red);
    setLayout(new GridBagLayout());
    add(scrollPane, gbc);
    add(Jp1);
    add(Jp, gbc2);
    setBorder(new EmptyBorder(3, 5, 5, 3));
       
    setSize(600,400);
   
    setVisible(true);
   
View Full Code Here

        mainPanel.add(boardTablePanel, BorderLayout.CENTER);
        boardTablePanel.add(updateSelectedBoardButton, BorderLayout.NORTH);
        boardTablePanel.add(new JScrollPane(boardTable), BorderLayout.CENTER);
        final JPanel summaryPanel = new JPanel();
        summaryPanel.setLayout(new BoxLayout(summaryPanel, BoxLayout.X_AXIS));
        summaryPanel.setBorder(new EmptyBorder(5,0,0,0));
        summaryPanel.add(summaryLabel);
        summaryPanel.add(Box.createRigidArea(new Dimension(15,3))); // ensure minimum glue size
        summaryPanel.add(Box.createHorizontalGlue());
        summaryPanel.add(updateButton);

        boardTablePanel.add(summaryPanel, BorderLayout.SOUTH);
        boardTablePanel.setBorder( new CompoundBorder(
                                                     new EtchedBorder(),
                                                     new EmptyBorder(7,7,7,7)
                                                     ));
        boardTablePanel.setBorder( new CompoundBorder(
                                                     new EmptyBorder(7,7,7,7),
                                                     boardTablePanel.getBorder()
                                                     ));

        final JPanel buttonsPanel = new JPanel();
        buttonsPanel.setLayout(new BoxLayout(buttonsPanel, BoxLayout.X_AXIS));
View Full Code Here

      gridBagConstraints.gridy = 2;
      gridBagConstraints.gridx = 2;
      //rootAndTree.add(getIndexOptionPane(), gridBagConstraints);
     
     
      rootAndTree.setBorder(new EmptyBorder(5, 5, 3, 3));
    }
    return rootAndTree;
  }
View Full Code Here

      tableInfoSplitPane.setOneTouchExpandable(true);

      restoreSplitPaneLocations();

      //BORDER TWEAKING
      tableInfoSplitPane.setBorder(new EmptyBorder(5, 0, 0, 0));
    }
    return tableInfoSplitPane;
  }
View Full Code Here

      tablePanel = new JPanel();
      tablePanel.setLayout(new GridBagLayout());
      tablePanel.add(tableScrollPane, gbc);
      //tablePanel.add(getIndexInfoPane(),gbc2);
      tablePanel.add(getjPanelOption(), gbc2);
      tablePanel.setBorder(new EmptyBorder(3, 5, 5, 3));
    }
    return tablePanel;
  }
View Full Code Here

TOP

Related Classes of javax.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.