Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , , , ,

Sponsored Links



How to use SystemColor class?

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 09-03-2010
Member
 
Join Date: Jan 2010
Posts: 99
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.
Reply With Quote
  #2  
Old 09-03-2010
Praetor's Avatar
Member
 
Join Date: Apr 2008
Posts: 1,937
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.
Reply With Quote
  #3  
Old 09-03-2010
Member
 
Join Date: May 2008
Posts: 1,990
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); 
       }
  }
}
Reply With Quote
  #4  
Old 09-03-2010
kelfro's Avatar
Member
 
Join Date: Apr 2008
Posts: 1,976
Re: How to use SystemColor class?

Hi friend,

I suggest you to review following some fields which are used with SystemColor class:
  • inactiveCaptionText
  • INACTIVE_CAPTION_TEXT
  • controlLtHighlight
  • CONTROL_LT_HIGHLIGHT
  • activeCaptionBorder
Reply With Quote
  #5  
Old 09-03-2010
Zecho's Avatar
Member
 
Join Date: May 2008
Posts: 2,267
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);
    }
}
Reply With Quote
Reply

  TechArena Community > Software > Software Development


Thread Tools Search this Thread
Search this Thread:

Advanced Search


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


All times are GMT +5.5. The time now is 11:04 AM.