Answers for "change color of jframe"

1

how to set background color in jframe in java

package Exaple;

import java.awt.Color;

import javax.swing.JFrame;

public class Window {

	public static void main(String[] args) {
		
		JFrame frame = new JFrame(); 
		frame.setExtendedState(JFrame.MAXIMIZED_BOTH); 
		frame.setVisible(true);
		frame.setTitle("Expaple");
		frame.setBackground(Color.BLUE);
	}

}
Posted by: Guest on July-24-2020
0

JFrame background color

setBackground(Color.red);
Posted by: Guest on January-21-2020
0

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);
   }
}
Posted by: Guest on March-11-2021

Code answers related to "change color of jframe"

Browse Popular Code Answers by Language