在要变地方
if(x ==1)
{
JLabel1.setForegroud(Color.red) ;
}
if(x ==1)
{
JLabel1.setForegroud(Color.red) ;
}
解决方案 »
- 需要用java在一个指定的cmd窗口中输入一个字母,例如“y”,再回车,分管够
- JAVA.AWT包中的ToolKit类是如何获得屏幕尺寸的?
- 在线急等!!请教关于javaMail 验证的问题
- 如何把一个自定义的类保存成文件,如何读写?
- Java中有没有自定义事件呢?
- 两个关于多线程的问题,对多线程熟悉的朋友解答
- Java 网络编程---SL275练习题疑惑
- 编译成.class的文件能否反编译成.java文件
- applet可以直接调用session bean吗?
- The expression of type List needs unchecked conversion to conform to List<Guest>
- 关于JTable的单元的编辑问题!
- 初级问题!
contentPane.setLayout(new FlowLayout());
JLabel jl=new JLabel("HelloWorld");
jl.setText("jTextField1");
contentPane.add(jl);
Color[] color=new Color[]{
new Color(00,00,00),
new Color(255,00,00),
new Color(00,255,00),
new Color(00,00,255)
};
JComboBox jcb=new JComboBox(new String[]{"1","2","3","4"});
jcb.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Frame1.this.jl.setForeground(Frame1.this.color[((JComboBox)e.getSource()).getSelectedIndex()]);
Frame1.this.validate();
}
});
contentPane.add(jcb);