Code example for TitledBorder

Methods: getTitlegetTitleFontgetTitleJustificationgetTitlePosition

    TestCase.assertNotNull("JPanel pnl auto bound through Swixml", pnl);
    Border border = pnl.getBorder();
    TestCase.assertNotNull("panel elem. has a border attribute def. in the XML Descriptor", border);
    TestCase.assertTrue("XML Descriptor declared a TitledBorder for this Panel", border.getClass().isAssignableFrom(TitledBorder.class));
    TitledBorder tb = (TitledBorder) border;
    TestCase.assertEquals("Title like set in XML", "myTitle", tb.getTitle());
    TestCase.assertEquals("Title Font like set in XML", Font.decode("VERDANA-BOLD-18"), tb.getTitleFont());
    TestCase.assertEquals("Title Justification like set in XML", TitledBorder.CENTER, tb.getTitleJustification());
    TestCase.assertEquals("Title Position like set in XML", TitledBorder.BELOW_BOTTOM, tb.getTitlePosition());
Connect your IDE to all the code out there  Get Codota for Java