Package javax.swing.border

Examples of javax.swing.border.CompoundBorder


    public void setDemoBorder(JPanel p) {
        int top  =  (p.getComponentCount()+1 >= 3)      ? 0 : 5;
        int left = ((p.getComponentCount()+1) % 2) == 0 ? 0 : 5;
        EmptyBorder eb = new EmptyBorder(top,left,5,5);
        SoftBevelBorder sbb = new SoftBevelBorder(SoftBevelBorder.RAISED);
        setBorder(new CompoundBorder(eb, sbb));
    }
View Full Code Here


    public CloningFeature() {

        setLayout(new BorderLayout());
        EmptyBorder eb = new EmptyBorder(5,5,5,5);
        SoftBevelBorder sbb = new SoftBevelBorder(SoftBevelBorder.RAISED);
        setBorder(new CompoundBorder(eb, sbb));

        ta = new JTextArea("Cloning Demonstrated\n\nClicking once on a demo\n");
        ta.setMinimumSize(new Dimension(300,500));
        JScrollPane scroller = new JScrollPane();
        scroller.getViewport().add(ta);
View Full Code Here

        String title1 = "title1";
        String title2 = "title2";
        assertNull(aContext.getTitledBorderText());
        panel.setBorder(new TitledBorder(title1));
        assertEquals(aContext.getTitledBorderText(), title1);
        panel.setBorder(new CompoundBorder(new TitledBorder(title1), new TitledBorder(title2)));
        assertNull(aContext.getTitledBorderText());
    }
View Full Code Here

        Border border = null;
        assertNull(aContext.getBorderTitle(border));
        border = new TitledBorder(title1);
        assertNotNull(aContext.getBorderTitle(border));
        assertEquals(aContext.getBorderTitle(border), title1);
        border = new CompoundBorder(new TitledBorder(title1), new EmptyBorder(1, 1, 1, 1));
        assertNotNull(aContext.getBorderTitle(border));
        assertEquals(aContext.getBorderTitle(border), title1);
        border = new CompoundBorder(new EmptyBorder(1, 1, 1, 1), new TitledBorder(title2));
        assertNotNull(aContext.getBorderTitle(border));
        assertEquals(aContext.getBorderTitle(border), title2);
        border = new CompoundBorder(new TitledBorder(title1), new TitledBorder(title2));
        assertNotNull(aContext.getBorderTitle(border));
        assertEquals(aContext.getBorderTitle(border), title2);
        border = new CompoundBorder(new CompoundBorder(new TitledBorder(title1),
                new TitledBorder(title2)), new CompoundBorder(new TitledBorder(title3),
                new TitledBorder(title4)));
        assertNotNull(aContext.getBorderTitle(border));
        assertEquals(aContext.getBorderTitle(border), title4);
        border = new CompoundBorder(new CompoundBorder(new TitledBorder(title1),
                new TitledBorder(title2)), new CompoundBorder(new TitledBorder(title3),
                new EmptyBorder(1, 1, 1, 1)));
        assertNotNull(aContext.getBorderTitle(border));
        assertEquals(aContext.getBorderTitle(border), title3);
        border = new CompoundBorder(new CompoundBorder(new TitledBorder(title1),
                new TitledBorder(title2)), new CompoundBorder(new EmptyBorder(1, 1, 1, 1),
                new EmptyBorder(1, 1, 1, 1)));
        assertNotNull(aContext.getBorderTitle(border));
        assertEquals(aContext.getBorderTitle(border), title2);
        border = new CompoundBorder(new CompoundBorder(new EmptyBorder(1, 1, 1, 1),
                new TitledBorder(title2)), new CompoundBorder(new EmptyBorder(1, 1, 1, 1),
                new EmptyBorder(1, 1, 1, 1)));
        assertNotNull(aContext.getBorderTitle(border));
        assertEquals(aContext.getBorderTitle(border), title2);
        border = new CompoundBorder(new CompoundBorder(new TitledBorder(title1),
                new EmptyBorder(1, 1, 1, 1)), new CompoundBorder(new EmptyBorder(1, 1, 1, 1),
                new EmptyBorder(1, 1, 1, 1)));
        assertNotNull(aContext.getBorderTitle(border));
        assertEquals(aContext.getBorderTitle(border), title1);
    }
View Full Code Here

        swatchPanel.addMouseListener(mainSwatchListener);
        recentSwatchListener = new RecentSwatchListener();
        recentSwatchPanel.addMouseListener(recentSwatchListener);


        Border border = new CompoundBorder(new LineBorder(Color.black),
                new LineBorder(Color.white));
        swatchPanel.setBorder(border);
        gbc.weightx = 1.0;
        gbc.gridwidth = 2;
        gbc.gridheight = 2;
View Full Code Here

    else
    {
      historyModel = HistoryModel.getModel(name);
      if(textFieldBorder != null)
      {
        setBorder(new CompoundBorder(textFieldBorder,
          new HistoryBorder()));
      }
    }
    index = -1;
    repaint();
View Full Code Here

 
  /** Alap konstruktor, bordert is beállít */
  public TransparentPanel() {
    super();
    setOpaque(false);
    setBorder(new CompoundBorder(new EmptyBorder(5, 5, 5, 5), new BevelBorder(BevelBorder.RAISED)));
  }
View Full Code Here

        JLabel statusLabel = new JLabel(STATUS);
        JLabel typeLabel = new JLabel(TYPE);

        TitledBorder titledBorder = new TitledBorder(SESSION_KEY);
        titledBorder.setTitleColor(Color.BLUE);
        CompoundBorder border = BorderFactory.createCompoundBorder(titledBorder,
                BorderFactory.createEmptyBorder(5, 5, 5, 5));
        setBorder(border);

        setLayout(new MigLayout("insets 0, wrap 2", "[align left]rel[grow, fill]", "[align center]25[]"));
View Full Code Here

        JLabel statusLabel = new JLabel(STATUS);
        JLabel typeLabel = new JLabel(TYPE);

        TitledBorder titledBorder = new TitledBorder(SESSION_KEY);
        titledBorder.setTitleColor(Color.BLUE);
        CompoundBorder border = BorderFactory.createCompoundBorder(titledBorder,
                BorderFactory.createEmptyBorder(5, 5, 5, 5));
        setBorder(border);

        setLayout(new MigLayout("insets 0, wrap 2", "[align left]rel[grow, fill]", "[align center]25[]"));
View Full Code Here

    });
   
    buttonPanel.add(okButton);
   
    label      .setBorder(new EmptyBorder(10, 5, 5, 5));
    detailsPane.setBorder(new CompoundBorder(new EmptyBorder(0, 5, 0, 5), detailsPane.getBorder()));
   
    add(label, BorderLayout.NORTH);
    add(detailsPane);
    add(buttonPanel, BorderLayout.SOUTH);
  }
View Full Code Here

TOP

Related Classes of javax.swing.border.CompoundBorder

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.