|
| |||||||||
| Tags: class, java, java clases, java class, systemcolor, systemcolor class |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| How to use SystemColor class?
Hello friends, I just started to learn the java class concepts. While this I am not able to get use of SystemColor class. I don't know anything about the SystemColor class methods as well as it's constructors. I have gone through various books, but didn't get proper details. If you know anything about the SystemColor class of java, then please let me aware about the same. I am waiting for your reply. |
|
#2
| ||||
| ||||
| Re: How to use SystemColor class?
Hi, The SystemColor class is basically used to encapsulate symbolic colors representing the color of native GUI objects. This java class is hired from the package 'java.awt.Color'. It extends all the properties of 'Color' class. In order to compare the "current" RGB value of a SystemColor object with a non-symbolic Color object, getRGB should be used rather than equals. |
|
#3
| |||
| |||
| Re: How to use SystemColor class?
Example of SystemColor class of java: Code: import java.awt.Color;
import java.awt.SystemColor;
public class SystemColorDM
{
public static void main(String[] abg)
{
Color[] sysColor1 = new Color[]
{
SystemColor.menuText,
SystemColor.scrollbar,
SystemColor.text,
SystemColor.controlDkShadow,
SystemColor.desktop,
SystemColor.inactiveCaption,
SystemColor.inactiveCaptionBorder,
SystemColor.window,
SystemColor.windowBorder,
SystemColor.windowText};
SystemColor.inactiveCaptionText,
SystemColor.info,
SystemColor.infoText,
SystemColor.menu,
SystemColor.textHighlight,
SystemColor.textHighlightText,
SystemColor.textInactiveText,
SystemColor.textText,
for(Color c1: sysColor1){
System.out.println(c1);
}
}
} |
|
#4
| ||||
| ||||
| Re: How to use SystemColor class?
Hi friend, I suggest you to review following some fields which are used with SystemColor class:
|
|
#5
| ||||
| ||||
| Re: How to use SystemColor class?
Hello friend, Following java code will give you something idea about the SystemColor class: Code: java.awt.SystemColor
using System.Windows.Forms;
using System.Windows;
class SystemColorSample
{
public static void Main(String dh[])
{
Application.Run(new HundredPixelsSquare());
}
public HundredPixelsSquare()
{
Text1 = "Pixels Square";
ResizeRedraw = true;
}
protected override void OnPaint(PaintEventArgs pea1)
{
DoPage(pea1.Graphics, ForeColor, ClientSize.Width, ClientSize.Height);
}
protected void DoPage(Graphics grfx1, Color clr, int cx, int cy) {
Brush brush = SystemBrushes.FromSystemColor(SystemColors.MenuText);
grfx1.FillRectangle(brush, 200, 200, 100, 100);
}
} |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "How to use SystemColor class?" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Upgrade Sony Ericsson Xperia Play Micro SD card from class 2 8GB to class 4 32GB | Aaryan2011 | Portable Devices | 8 | 09-10-2011 12:06 AM |
| Using sizeof () class with empty base class in GCC | Alfiee | Software Development | 6 | 27-06-2011 11:31 AM |
| How to initialize a derived class with an instance of the base class in c#? | KAIRU26 | Software Development | 5 | 12-02-2010 06:23 PM |
| Ultra solid drives:Imation M-Class and S-Class | Regina | Portable Devices | 1 | 03-04-2009 11:34 AM |
| Good news for CBSE CLASS X & CLASS IX - visit learnnext | surya_expert | Education Career and Job Discussions | 0 | 13-12-2008 12:09 PM |