setBackground(Color.black);
server_crash
Postaholic
2,111 posts since Jun 2004
Reputation Points: 113
Solved Threads: 20
Have you tried:
fm.setBackground(Color.black);
server_crash
Postaholic
2,111 posts since Jun 2004
Reputation Points: 113
Solved Threads: 20
hehe. A JPanel was my next suggestion.
server_crash
Postaholic
2,111 posts since Jun 2004
Reputation Points: 113
Solved Threads: 20
This works. It's a little bit different than yours though.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class CPB extends JFrame {
public CPB() {
Container content = getContentPane();
setContentPane(content);
setBackground(Color.black);
setSize(300,300);
setLayout(new FlowLayout());
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
public void paint(Graphics g) {
g.setColor(Color.white);
g.drawString("Text should be here :S",100,100);
}
public static void main(String[] args) {
CPB cmp = new CPB();
}
}
server_crash
Postaholic
2,111 posts since Jun 2004
Reputation Points: 113
Solved Threads: 20