Apache NetBeans
Apache NetBeans
Latest release

Apache NetBeans 24

Download

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.