DJ-Raven / flatlaf-dashboard

Java Swing Dashboard build with flatlaf look and feel
54 stars 13 forks source link
dashboard flatlaf gui java-swing

Java Dashboard Light and Dark mode

This dashboard build by using java swing with flatlaf look and feel

Library use

Sample code to show form

//  Application class from package raven.application
//  Parameter as java.awt.Component

Application.showForm(new PanelForm());

//  Set menu selection by index and subIndex

Application.setSelectedMenu(0, 0);

Menu Items

//  Modify this code in raven.menu.Menu.java

private final String menuItems[][] = {
    {"~MAIN~"}, //  Menu title
    {"Dashboard"},
    {"Email", "Inbox", "Read", "Compost"},
};

Menu Event

menu.addMenuEvent(new MenuEvent() {
    @Override
    public void menuSelected(int index, int subIndex, MenuAction action) {
        if (index == 1) {
            if (subIndex == 1) {
                Application.showForm(new FormInbox());
            } else if (subIndex == 2) {
                Application.showForm(new FormRead());
            }
        } else {
            action.cancel();
        }
    }
});

More custom you can apply flatlaf style properties

Update Note