LL&P --- I am novice. Would like to have choice of standard colors when add( textLabel ) to a panel, but cannot figure out how to do so. Can you help? Thanks !!
Ashwin Desai
Ranch Hand
Joined: Jul 17, 2000
Posts: 124
posted
0
Hi, you can change colors using label.setForeground(new Color(x,y,z)); // For Foreground (Font) & label.setBackground(new Color(x,y,z)); // For Background x,y,x are the RGB values for the colors. Alternatively you can use defined static contants in the Color class as Color.black, Color.red, Color.green, Color.gray, Color.lightGray, Color.white, Color.blue & maybe more. Hope this helps.
Don Smathers
Ranch Hand
Joined: Mar 04, 2001
Posts: 31
posted
0
Many thanks --- worked perfectly --- Don
Originally posted by Ashwin Desai: Hi, you can change colors using label.setForeground(new Color(x,y,z)); // For Foreground (Font) & label.setBackground(new Color(x,y,z)); // For Background x,y,x are the RGB values for the colors. Alternatively you can use defined static contants in the Color class as Color.black, Color.red, Color.green, Color.gray, Color.lightGray, Color.white, Color.blue & maybe more. Hope this helps.
subject: Label : can change font OK. How about color?