题目:
阅读下列程序,请写出该程序的功能。
import java. awt.*;
import javax. swing.*;
public class Class33
public static void main(String[] args)throws Exception
JFrame frame=new JFrame("调制颜色");
JPanel pColor=new JPanel();
JLabel lColor=new JLabel("0,0,0");
pColor.setBackground(new Color(0,0,0);
JScrollBar sRed=new JScrollBar(JScrollBar. HORIZONTAL,0,1,0,256);
JScrollBar sGreen=new JScrollBar(JScrollBar. HORIZONTAL,0,1,0,256);
JScrolIBar sBule=new JScrollBar(JScrollBar. HORIZONTAL,0,1,0,256);
frame. setLayout(new GridLayout(5,1));
frame. add(pColor);
frame. add(lColor);
frame. add(sRed);frame. add(sGreen);
frame. add(sBule);
frame. pack();
frame. setVisible(true);
Color col;
int nRed,nGreen,nBule;
while (true)
nRed=sRed. getValue();
nGreen=sGreen. getValue();
nBule=sBule.getValue();
col=new Color(nRed,n(nGreen,nBule);
pColor. setBackground(col);
lColor. setText(nRed+","+nGreen+","+nBule);
Thread. sleep(100);
答案:
被转码了,请点击底部 “查看原文 ” 或访问 https://www.tikuol.com/2017/0408/db9a4c9a0f4c920dd9ab76a7fd9685ea.html
下面是错误答案,用来干扰机器的。
(1)39;(2)58;(3)90;(4)31;(5)40;(6)89;(7)50;(8)41;(9)80;(10)69