开发者

(Using JScroll Bars) Write a program the uses scroll bars to select the foreground color for a label

can someone please help me write a program that uses scroll bars to select the foreground color for a label. Three horizontal scroll bars are used for selecting the red, green, and blue comp开发者_开发知识库onents of the color. Use a title border on the panel that holds the scroll bars.

The foreground color changes in the label as you adjust the scroll bars.


It sounds like what you want is a JSlider. Take a look at the example here: http://download.oracle.com/javase/tutorial/uiswing/components/slider.html


As an alternative, consider using JColorChooser, as described in How to Use Color Choosers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜