Code example for TitledBorder

0
        listPanel.setOpaque(false);
        listPanel.setBorder(new TitledBorder(
                new RoundedBorder(UIHelper.LIGHT_GREEN_COLOR, 4), 
                title, TitledBorder.DEFAULT_JUSTIFICATION,
                TitledBorder.DEFAULT_POSITION, UIHelper.VER_12_BOLD,
                UIHelper.LIGHT_GREY_COLOR)); 
 
        if (list instanceof ExtendedJList) {
            ((ExtendedJList) list).getFilterField().setBorder(new LineBorder(UIHelper.LIGHT_GREY_COLOR, 1, true));
            ((ExtendedJList) list).getFilterField().setCaretColor(UIHelper.LIGHT_GREY_COLOR);
            ((ExtendedJList) list).getFilterField().setOpaque(false);
            UIHelper.renderComponent(((ExtendedJList) list).getFilterField(), UIHelper.VER_11_BOLD, UIHelper.LIGHT_GREY_COLOR, false);
 
            listPanel.add(((ExtendedJList) list).getFilterField(), BorderLayout.NORTH);
        } 
        listPanel.add(listScroller, BorderLayout.CENTER);
        listPanel.setPreferredSize(new Dimension(250, 200));
 
        return listPanel;
    } 
Experience pair programming with AI  Get Codota for Java