Java swing Header & Footer background color

2.1k views Asked by At

enter image description hereIs there any way to set Header and Footer in Java Swing?

Actually I am using theme in my application and I have set fixed background color for all panels. But now the work is to set different background color of Header and Footer panel. Can you give me any suggestion?

Thanks in advance..

1

There are 1 answers

2
Joop Eggen On

Header and Footer are probably just JPanels, so you can do setBackground(Color.YELLOW) or such. As you probably have several header and footes (seeing those tabs), you could make a single class:

public class HeaderOrFooter extends JPanel {
    private static final Color bg = new Color(0xFFFF66);
    public HeaderOrFooter() {
       setBackground(bg);
    }
}

You can even use a http://docs.oracle.com/javase/6/docs/api/java/awt/SystemColor.html (for theming), like SystemColor.info.