这是颜色的常量,自己设定的呀...
static Color black
The color black.
static Color BLACK
The color black.
static Color blue
The color blue.
static Color BLUE
The color blue.
static Color cyan
The color cyan.
static Color CYAN
The color cyan.
static Color DARK_GRAY
The color dark gray.
static Color darkGray
The color dark gray.
static Color gray
The color gray.
static Color GRAY
The color gray.
static Color green
The color green.
static Color GREEN
The color green.
static Color LIGHT_GRAY
The color light gray.
static Color lightGray
The color light gray.
static Color magenta
The color magenta.
static Color MAGENTA
The color magenta.
static Color orange
The color orange.
static Color ORANGE
The color orange.
static Color pink
The color pink.
static Color PINK
The color pink.
static Color red
The color red.
static Color RED
The color red.
static Color white
The color white.
static Color WHITE
The color white.
static Color yellow
The color yellow.
static Color YELLOW
The color yellow.
static Color black
The color black.
static Color BLACK
The color black.
static Color blue
The color blue.
static Color BLUE
The color blue.
static Color cyan
The color cyan.
static Color CYAN
The color cyan.
static Color DARK_GRAY
The color dark gray.
static Color darkGray
The color dark gray.
static Color gray
The color gray.
static Color GRAY
The color gray.
static Color green
The color green.
static Color GREEN
The color green.
static Color LIGHT_GRAY
The color light gray.
static Color lightGray
The color light gray.
static Color magenta
The color magenta.
static Color MAGENTA
The color magenta.
static Color orange
The color orange.
static Color ORANGE
The color orange.
static Color pink
The color pink.
static Color PINK
The color pink.
static Color red
The color red.
static Color RED
The color red.
static Color white
The color white.
static Color WHITE
The color white.
static Color yellow
The color yellow.
static Color YELLOW
The color yellow.
解决方案 »
- 为什么BufferedInputtream继承自过滤字节流,而BufferedReader却并非继承自过滤字符流呢?
- 怎么利用javadoc,将注释文档提取为一个HTML文件,并用Web浏览器观看。
- SWT中实时显示时间出错
- java里面有没有类似struct的变量?
- 菜鸟问?
- 关于table表中,打印一条或多条记录的方法。
- 哪有visual j++ 6.0下载!!!急急急!!!!
- 下载Documentation FOR JAVA 2 SDK。在线急等
- 用jbuilder开发的applet在浏览器中显示空白?
- 线程有几种状态?
- 菜鸟在看 thinking in java 给点建议。谢谢!
- 问个GUI问题
import javax.swing.*;public class aa extends JFrame
{
public static void main(String args[])
{
aa d = new aa();
d.getContentPane().setBackground(Color.black);
d.setSize(200, 200);
d.setVisible(true);
}
}
GraphicsEnvironment environment = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice device = environment.getDefaulScreenDevice(); DisplayMode displaymode;
device.setFullScreenWindow(frame);// frame extends from JFrame;
device.setDeviceDiplayMode(displaymode); setBackground(Color.black);
setForeground(Color.black);
Graphics g = this.getGraphics();
g.setColor(Color.red);
g.drawString("Hello World!", 20, 50);
g.dispose();
但却不能正常显示黑色的背景,怎么回事?