Looking at this example, I have to create a form look like:
If you press the tab button, it will change the color of the background according to the color of the button.
Here is the code to do that:
private void jTabbedPane1MouseClicked(java.awt.event.MouseEvent evt) {
getContentPane().setBackground(Color.YELLOW)
};
and this is the result:
My problem is: I can't set the color for the whole background, and I can't change the variable name of the tab, so I can't set different events with different colors for each tab. It says that two components in the same form cannot have the same name
Any help is appreciated.