Results 1 to 5 of 5

Thread: How to use SystemColor class?

  1. #1
    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.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    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. #3
    Join Date
    May 2008
    Posts
    2,012

    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. #4
    Join Date
    Apr 2008
    Posts
    2,005

    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

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    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);
        }
    }

Similar Threads

  1. Replies: 8
    Last Post: 08-10-2011, 11:06 PM
  2. What is the difference between Local class and global class in C++?
    By Dëfrim in forum Software Development
    Replies: 4
    Last Post: 03-01-2011, 10:44 PM
  3. Replies: 5
    Last Post: 12-02-2010, 06:23 PM
  4. Ultra solid drives:Imation M-Class and S-Class
    By Regina in forum Portable Devices
    Replies: 1
    Last Post: 03-04-2009, 10:34 AM
  5. Good news for CBSE CLASS X & CLASS IX - visit learnnext
    By surya_expert in forum Education Career and Job Discussions
    Replies: 0
    Last Post: 13-12-2008, 12:09 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,998,982.30515 seconds with 16 queries