I tried using:
frame1.getContentPane().setBackground(Color.yellow);
But it is not working. Can anyone help me?
import java.
You should give background color to JPanel and then use this JPanel in your JFrame rather than giving direct background to your JFrame.