Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 657453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:49:32+00:00 2026-05-13T22:49:32+00:00

I have been attempting to enhance my GUI system written in Java to use

  • 0

I have been attempting to enhance my GUI system written in Java to use subpixel antialiasing and have been successful, except for one remaining anomaly. This is a follow on to my other question from yesterday.

The remaining problem is that setting rendering hints KEY_ANTIALIASING to VALUE_ANTIALIAS_ON causes KEY_TEXT_ANTIALIASING to be ignored when it is set to an LCD (subpixel) AA value. Can anyone shed some light on this? Currently I am forced to VALUE_ANTIALIAS_OFF before rendering text and turn it back on after rendering text (so that other painting, like circles, etc, is AA’d).

This problem is proven by the self-contained test program below. As you can see if you run it, the circle is painted with AA when the font isn’t, and vice versa. It would be nice to have AA preconfigured to work for all painting.


Self Contained Test Program

import java.awt.*;
import java.awt.event.*;

public class AwtTestFrame1c extends Panel {

AwtTestFrame1c() {
    setBackground(SystemColor.control);
    }

public void paint(Graphics gc) {
    Graphics2D                          g2d = (Graphics2D)gc;
    int                                 py=0;

    py=paintText(g2d,py,RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB,true );
    py=paintText(g2d,py,RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB,false);
    }

private int paintText(Graphics2D dgc, int py, Object val, boolean aa) {
    char[]                              txt=("The quick brown fox jumped over the lazy dog ("+val+", General AA: "+aa+")").toCharArray();

    if(aa        ) { dgc.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON ); }
    else           { dgc.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_OFF); }
    if(val !=null) { dgc.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,val);                           }
    dgc.setFont(font);

    dgc.drawOval(5,py+5,15,15);
    dgc.drawChars(txt,0,txt.length,30,py+line-5);

    return (py+line);
    }

static private final Font                      font=new Font("SansSerif",Font.PLAIN,16);
static private final int                       line=25;

static public void main(String[] args) {
    Frame                               wnd=new Frame("AWT Antialiased Text Sample");

    wnd.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            System.exit(0);
            }
        });
    wnd.add(new AwtTestFrame1c());
    wnd.setSize(new Dimension(1000, 300));
    wnd.setVisible(true);
    }

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T22:49:32+00:00Added an answer on May 13, 2026 at 10:49 pm

    A bit of poking around found this: bug 6263951.

    Apparently the bustage is fixed in b17? I’m not exactly sure how to interpret the bug report.

    Definitely broken here on 1.6.0_17-b04 (MacOS X 10.5).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been attempting to enhance my GUI system written in Java to use
I have been attempting to have a object that I can use across multiple
I have been attempting to write some routines to read RSS and ATOM feeds
Have been studying the file system related classes of Adobe AIR 1.5, but so
I have been looking into IKVMing Apache's FOP project to use with our .NET
I have been attempting to handle the KeyDown event of a UserControl (page) in
I have been attempting to get log4net logging in my asp.net web application with
I have been attempting to build HLSL shader support into VLC player. I have
Have been looking at the MVC storefront and see that IQueryable is returned from
We have been using CruiseControl for quite a while with NUnit and NAnt. For

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.