Hi
Ich rufe aus einer andere Klasse folgende Klasse auf, mit dem Befehl:
Fehlermeldung FM = new Fehlermeldung();
Ich weiß, dort steht vieles unnötiges Zeug drin, aber ich wollte das Frame schwarz haben, es erscheint immer in grau!
Egal was ich tue, in grau.
Ich rufe aus einer andere Klasse folgende Klasse auf, mit dem Befehl:
Fehlermeldung FM = new Fehlermeldung();
Code:
import java.awt.Color;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class Fehlermeldung extends JFrame{
JPanel jFehlerPanel;
//JButton jButton_Zurueck;
JPanel Grid1_Panel;
JPanel Grid2_Panel;
JPanel Grid3_Panel;
JPanel Grid4_Panel;
JPanel Grid5_Panel;
JPanel Grid6_Panel;
JPanel Grid7_Panel;
JPanel Grid8_Panel;
JPanel Grid9_Panel;
//JLabel jFehlermeldungstext;
public Fehlermeldung() {
//this.jButton_Zurueck = new JButton("Zurück");
this.jFehlerPanel = new JPanel();
//this.jFehlermeldungstext = new JLabel();
//this.jFehlermeldungstext.setText("Das Passwortfeld bitte nicht leer lassen!!");
this.Grid1_Panel = new JPanel();
this.Grid2_Panel = new JPanel();
this.Grid3_Panel = new JPanel();
this.Grid4_Panel = new JPanel();
this.Grid5_Panel = new JPanel();
this.Grid6_Panel = new JPanel();
this.Grid7_Panel = new JPanel();
this.Grid8_Panel = new JPanel();
this.Grid9_Panel = new JPanel();
this.jFehlerPanel.setLayout(new GridLayout(3,3));
this.jFehlerPanel.add(Grid1_Panel);
this.jFehlerPanel.add(Grid2_Panel);
this.jFehlerPanel.add(Grid3_Panel);
this.jFehlerPanel.add(Grid4_Panel);
this.jFehlerPanel.add(Grid5_Panel);
this.jFehlerPanel.add(Grid6_Panel);
this.jFehlerPanel.add(Grid7_Panel);
this.jFehlerPanel.add(Grid8_Panel);
this.jFehlerPanel.add(Grid9_Panel);
this.Grid1_Panel.setBackground(Color.BLACK);
this.Grid1_Panel.setBackground(Color.BLACK);
this.Grid2_Panel.setBackground(Color.BLACK);
this.Grid2_Panel.setBackground(Color.BLACK);
this.Grid3_Panel.setBackground(Color.BLACK);
this.Grid3_Panel.setBackground(Color.BLACK);
this.Grid4_Panel.setBackground(Color.BLACK);
this.Grid4_Panel.setBackground(Color.BLACK);
this.Grid5_Panel.setBackground(Color.BLACK);
this.Grid5_Panel.setBackground(Color.BLACK);
this.Grid6_Panel.setBackground(Color.BLACK);
this.Grid6_Panel.setBackground(Color.BLACK);
this.Grid7_Panel.setBackground(Color.BLACK);
this.Grid7_Panel.setBackground(Color.BLACK);
this.Grid8_Panel.setBackground(Color.BLACK);
this.Grid8_Panel.setBackground(Color.BLACK);
this.Grid9_Panel.setBackground(Color.BLACK);
this.Grid9_Panel.setBackground(Color.BLACK);
//this.Grid5_Panel.add(jFehlermeldungstext);
this.getContentPane().add(jFehlerPanel);
this.setVisible(true);
this.setSize(800,600);
this.setTitle("Fehlermeldung...");
this.setResizable(false);
this.setLocationRelativeTo(null);
}
}
Ich weiß, dort steht vieles unnötiges Zeug drin, aber ich wollte das Frame schwarz haben, es erscheint immer in grau!
Egal was ich tue, in grau.