Changing the color set into a method when a jbutton is pressed

28 Views Asked by At
        private void btn_productManagementMouseClicked(java.awt.event.MouseEvent evt) {                                                   
        setColor(btn_productManagement);
        resetColor(btn_accounts);
        resetColor(btn_priceChecker);
        resetColor(btn_settings);
        resetColor(btn_signout);
        
        jTabbedPane1.setSelectedIndex(0);
        
    } 


    void setColor(JPanel panel){
         panel.setBackground(new Color(78,50,137));
                
    }
    
    void resetColor(JPanel panel){
        panel.setBackground(new Color(63,43,100));
                
    }

I have this GUI made from netbeans where I used a jlabel as my tab selector and this code handles the switching color or highlighting of the labels depending on the panel that is selected. I made a setting where you set a specific theme for the whole GUI and Im wondering how can I manipulate the code inside of the setColor and resetColor method and change the color that is set with each methods. I'll leave a picture for visualization. Thanks!

Here's the tab section

https://i.stack.imgur.com/jKpJP.png

0

There are 0 best solutions below