how to set frame colo in java
getContentPane().setBackground(Color.YELLOW); //Whatever color
how to set frame colo in java
getContentPane().setBackground(Color.YELLOW); //Whatever color
change color of jframe
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JFrame;
public class SwingDemo {
public static void main(String[] args) {
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setPreferredSize(new Dimension(550, 300));
frame.getContentPane().setBackground(Color.BLUE);
frame.pack();
frame.setVisible(true);
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us