Created
July 4, 2016 23:08
-
-
Save altayalp/77f80ab4718e1f238073a433b5b87a59 to your computer and use it in GitHub Desktop.
Simple example to set hex background color for the JFrame
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Color; | |
import java.awt.Dimension; | |
import javax.swing.JFrame; | |
/** | |
* | |
* @author altayalp | |
*/ | |
public class HexBackgorundFrame { | |
private static void createJframe() { | |
JFrame frame = new JFrame ("Hex color backgorund window"); | |
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); | |
frame.getContentPane().setBackground( Color.decode("#000000") ); // set background color | |
frame.setPreferredSize(new Dimension(500, 300)); | |
frame.pack(); | |
frame.setVisible(true); | |
} | |
public static void main(String[] args) { | |
createJframe(); | |
} | |
} |
thanks
Hey, thanks!
Thank you!
Thank you
ty
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks a lot