java颜色选择器计算机等级考试
文章作者 100test 发表时间 2010:01:01 12:30:53
来源 100Test.Com百考试题网
package swimg.
import java.awt.BorderLayout.
import java.awt.Color.
import java.awt.Container.
import javax.swing.BorderFactory.
import javax.swing.JColorChooser.
import javax.swing.JComponent.
import javax.swing.JFrame.
import javax.swing.JLabel.
import javax.swing.JPanel.
public class ColorChooserDemo extends JPanel{
protected JColorChooser tcc.
protected JLabel banner.
public ColorChooserDemo(){
super(new BorderLayout()).
JPanel bannerPanel=new JPanel(new BorderLayout()).
bannerPanel.setBorder(BorderFactory.createTitledBorder("chooser Text color")).
tcc=new JColorChooser(Color.red).
add(bannerPanel,BorderLayout.CENTER).
add(tcc,BorderLayout.PAGE_END).
}