Apache NetBeans Wiki Index

Note: These pages are being reviewed.

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.

Apache Migration Information

The content in this page was kindly donated by Oracle Corp. to the Apache Software Foundation.

This page was exported from http://wiki.netbeans.org/DevFaqCustomFontSize , that was last modified by NetBeans user Tboudreau on 2010-02-25T16:22:26Z.

NOTE: This document was automatically converted to the AsciiDoc format on 2018-02-07, and needs to be reviewed.