题目内容

阅读以下说明和Java代码,将应填入(n)处的语句写在对应栏内。
【说明】
本程序通过移动滑动条修改颜色RGB值,从而控制颜色。程序中有一个面板、3个标签和3个滑动条,标签和滑动条一一对应,分别对应三原色红、绿、蓝,任意拖动其中的一个滑动条,所对应的颜色值就会发生变化,面板的颜色也会发生对应的变化,如下图所示,滑动条值的范围是0~255。
【Java代码】
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class simple extends JFrame. implements AdjustmentListener{
public simple(){
setTitle("simple");
setSize(300, 200);
addWindowListener(new WindowAdapter(){
public void windowClosing((1)){
System.exit(0);
}
});
Container contentPane=getContentPane();
JPanel p=(2);
p.setLayout(new GridLayout(3, 2));
p.add(redLabel=new JLabel("Red 0"));
p.add(red=new JScrollBar(Adjustable. HORIZONTAL, 0, 0, 0, 255));
red.setBlocklncrement(16);
red.addAdjustmentListener(this);
p.add(greenLabel=(3) ("Green 0"));
p.add(green=new JScrollBar(Adjustable.HORIZONTAL 0, 0, 0, 255));
green setBIocklncrement(16);
green.addAdjustmentListener(this);
p.add(blueLabel=new JLabel("Blue 0"));
p.add(btue=new JScrollBar(Adjustable. HORIZONTAL, 0, 0, 0, 255));
blue,setBIocklncrement(16);
blue.addAdjustmentListener(this);
contentPane.add(p, "South");
colorPanet=new JPanel();
colorPanet.setBackground(new Color(0, 0, 0));
contentPane.add((4),"Center");
} public void adjustmentValueChanged(AdjustmentEvent evt){
redLabel.setText("Red"+red.getValue());
greenLabel.setText("Green"+green.getValue());
blueLabel.setText("Blue"+blue.getValue());
coiorPanel.setBackground(new Color(red.getValue(), green.getValue(), blue.getValue()));
colorPanel.repaint();
}
public static void main(String[] args){
JFrame. f=(5);
f.show();
}
private JLabel redLabel;
private JLabel greenLabel;
private JLabel blueLabel;
private JScrollBar red;
private JScroilBar green;
private JScrollBar blue;
private JPanel colorPanel;

查看答案
更多问题

Since rainforest bacteria and trees depend on cacti other for life, the relationship they

A—overpopulation B—under population
C—working population D—population waiting for employment
E—urban population F—rural population
G—population reproduction H—population increase
I—population decrease J—population base
K—population distribution L—population density
M—population quality N—population pyramid
O—population statistics P—population theory
Q—population studies
51. ()在业人口 ()人口密度
52. ()人口增长 ()人口年龄金字塔
53. ()城市人口 ()人口质量
54. ()人口理论 ()人口分布
55. ()待业人口 ()人口过剩

第二节 书面表达
请写一封投诉信,你于2001年买了一台打字机,但没几天就坏了。你带着这台打字机来到了ABC商店,但ABC商店让你等了数月才修好。但6个月后,这台打字机又坏了,信中请你指明你的打字机的型号及投诉要求。
注意:词数在80—100。

简述Excel 2000中引用单元格的三种不同方法。

答案查题题库