Java:JPanel

Aus Alexander's Wiki
Zur Navigation springen Zur Suche springen
    import javax.swing.JPanel;
    import javax.swing.BorderFactory;
    import javax.swing.border.Border;
    import javax.swing.border.TitledBorder;

    JPanel myPanel;


Umrandungen innerhalb eines JPanels

    Border lb = BorderFactory.createLineBorder(Color.BLACK, 1);
    TitledBorder border = BorderFactory.createTitledBorder(lb, title);
    border.setTitleFont(border.getTitleFont().deriveFont(14f));
    border.setTitleFont(border.getTitleFont().deriveFont(Font.BOLD));
    border.setTitleColor(Color.BLACK);
    myPanel.setBorder(border);