Search Posts

hard to theme netbeans perfectly

It is hard to theme netbeans using traditional swing look & feel. The reason is netbean’s tab container is not traditional swing JTabbedPane. See the post

Netbeans use a AbstractViewTabDisplayerUI to support only few “default look & feel”, such as Metal, Nimbus, Aqua. see below:


The problem is : This default look & feel tab container styles are preset to netbeans source code. So we *DONT* have a way to override it. And each of them just draw things by its own ways (see below), even you look & feel is based on one of them, you CANT override its style.

    private void paintBottomBorder(Graphics g, JComponent c) {
        Color color = isActive() ? getActBgColor() : getInactBgColor();
        Rectangle bounds = c.getBounds();
        g.fillRect(1, bounds.height - 3, bounds.width - 1, 2);
        g.drawLine(1, bounds.height - 1, bounds.width - 1, bounds.height - 1);


When i apply peter-swing to netbeans, take a look below, the tab container is ugly (LHS). In right hand side, the tab should look like that.

netbeans tab is ugly

Leave a Reply

Your email address will not be published. Required fields are marked *