How can I set RenderingHints globally?

javacavaj :

For a Java application, can I set the RenderingHints on a global basis? Currently, I've defined these in the paintComponent method as shown below. I would prefer, however, to set them once when the application starts and have them persist throughout the session.

@Override
protected void paintComponent(Graphics g)
{
super.paintComponent(g);

Graphics2D g2d = (Graphics2D) g;
    g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
}

Thanks.

Michael Borgwardt :

There's a system property for that.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How can i set cascade mode Globally?

In Emacs, how can I set the cursor-type globally?

Can I globally set the timeout of HTTP connections?

How can I set json serializer options per Controller basis (not globally in startup)?

How can I globally set a custom HtmlEncoder to use in all Razor pages?

How can I set API Key Security Globally on API Gateway using Swagger

How can I add a function to FactoryBot globally?

How can I create async/await globally

How can I access a variable globally in flask

Can I set the altitude mode or extrude globally (only once)?

How to set umask globally?

How do I set TCPSocket attributes for only a method and not globally?

How do I set an Application's Icon Globally in Swing?

How can $(this) be available globally

How can I globally detect when the screen rotation changes?

How can I change SMTP details globally at runtime?

How can I use variables from a form globally in Laravel 8?

How can I initialize a global nested Dictionary globally?

How can I append string to list (array) globally?

How can I change UINavigationController's rightBarButtonItem globally?

How can I use a variable globally in js (across many files)?

How can I globally configure a Cargo profile option?

How can I create an alias for a class, globally, in Unity?

How can I mock a method globally for all tests in python

In SwiftUI, How can I app-globally predefine font styles?

How can I change the from address in *nix mail globally?

How can I disable Recycle Bin globally in Windows 8.1?

How i can register component globally and define default behavior?

How can I know the networkStatus of all queries in ApolloClient globally?