📄 tuxin.java
字号:
/*
* Created on 2007-5-3
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
/**
* @author hulmous
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
import java.awt.*;
public class Tuxin extends Frame{
public Tuxin(String title){
super(title);
setLayout(new GridLayout(5,1));
setVisible(true);
setBounds(300,300,300,300);
Panel p1=new Panel();
TextField text=new TextField("0 0 0",20);
Scrollbar sRed=new Scrollbar(Scrollbar.HORIZONTAL,0,1,0,256);
Scrollbar sGreen=new Scrollbar(Scrollbar.HORIZONTAL,0,1,0,256);
Scrollbar sBlue=new Scrollbar(Scrollbar.HORIZONTAL,0,1,0,256);
add(p1);
add(text);
add(sRed);
add(sGreen);
add(sBlue);
int nRed,nGreen,nBlue;
while(true){
nRed=sRed.getValue();
nGreen=sGreen.getValue();
nBlue=sBlue.getValue();
text.setText(nRed+" "+nGreen+" "+nBlue);
Color c=new Color(nRed,nGreen,nBlue);
p1.setBackground(c);
}
}
public static void main(String[] args){
Tuxin tuxing=new Tuxin("图形");
tuxing.pack();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -