S
sou7edge
Gast
Hallo, ich habe ein kleines Problem mit zwei Komponenten, die keine andere Hintergrundfarbe als Weiß annehmen wollen! Hat da jemand eine Idee warum, der das nicht ändert?
Code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class GUI extends JFrame {
Container content;
Color color = new Color(255,255,255);
Font font = new Font("",Font.BOLD,12);
JTextField input = new JTextField();
JTextArea log;
public GUI() {
super("GUI");
setResizable(false);
log = new JTextArea(15,40);
log.setBackground(color);
log.setEditable(false);
log.setFont(font);
input.setBackground(color);
input.setFont(font);
content = getContentPane();
content.setLayout(new BorderLayout(3,3));
content.add(log,BorderLayout.CENTER);
content.add(input,BorderLayout.SOUTH);
input.addActionListener(this);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
pack();
setVisible(true);
}
public static void main(String[] args) {
GUI g = new GUI();
}
}