Colors in computers are generally made up using RGB mode i.e. Red, Green, Blue.
So in java if we generate random color values for RGB from 0 to 255 each we can make a whole new color out of it by passing this RGB to the color object.
To show the demo Swings have been used where the components are JFrame, JPanel & JButton placed using BorderLayout onto center & south.
The ActionListener for the button does the job of changing the background color of the panel.