?? 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 + -