Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.*;
- import java.awt.*;
- public class GUI
- {
- private JFrame fenster = new JFrame();
- public GUI() {
- fenster.setSize(600, 400);
- fenster.setLocation(400, 400);
- fenster.getContentPane().setBackground(Color.white);
- fenster.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- fenster.setVisible(true);
- fenster.setTitle("Paul ist dumm");
- }
- public void setzeGröße(int a, int b){
- fenster.setSize(a,b);
- }
- public void setBackground(Color color) {
- fenster.getContentPane().setBackground(color);
- }
- /*public void setHexBackground(String hexValue) {
- Color color = new Color.decode(hexValue);
- fenster.getContentPane().setBackground(color);
- }*/
- /*public void setStringBackground(String color) {
- Color color = new Color();
- switch (color) {
- case "black":
- color = Color.black;
- break;
- case "red":
- color = Color.red;
- break;
- case "green":
- color = Color.green;
- break;
- default:
- color = Color.white;
- break;
- }
- fenster.getContentPane().setBackground(color);
- }*/
- //public void setzeBackground(char name){
- // if ("black".equals(name)) {
- // fenster.getContentPane().setBackground(Color.black);}
- // if ("white".equals(name)) {
- // fenster.getContentPane().setBackground(Color.white);}
- // if ("blue".equals(name)) {
- //fenster.getContentPane().setBackground(Color.blue);}
- //if ("red".equals(name)) {
- //fenster.getContentPane().setBackground(Color.red);}
- //}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement