DevFaqCustomFontSize

I have a custom component. How can I make it respond to --fontsize like the rest of NetBeans?

Integer fontSize = (Integer) UIManager.get("customFontSize");
if (fontSize != null) {
    //--fontsize was passed - adjust your fonts accordingly
}

You can also just set your font with UIManager.getFont("controlFont") which will be set according to --fontsize, but sometimes you do need the actual value for using fixed width fonts or computing fixed cell height for an unusual font or similar.

The code in core.swing.plaf processes the --fontsize argument and sets the UIManager key/value pair if it was passed on startup.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo