There is no command line switch to change the font size for Swing. What you would have to do is to invoke the following method:
public static void adjustFontSize(int adjustment) {
UIDefaults defaults = UIManager.getDefaults();
List<Object> newDefaults = new ArrayList<Object>();
Map<Object, Font> newFonts = new HashMap<Object, Font>();
Enumeration<Object> en = defaults.keys();
while (en.hasMoreElements()) {
Object key = en.nextElement();
Object value = defaults.get(key);
if (value instanceof Font) {
Font oldFont = (Font)value;
Font newFont = newFonts.get(oldFont);
if (newFont == null) {
newFont = new Font(oldFont.getName(), oldFont.getStyle(), oldFont.getSize() + adjustment);
newFonts.put(oldFont, newFont);
}
newDefaults.add(key);
newDefaults.add(newFont);
}
}
defaults.putDefaults(newDefaults.toArray());
}
where adjustment
is the number of points that should be added to each font size.
If you don't have access to the source code, you can always write your own wrapper main class where you call
UIManager.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent event) {
if (event.getPropertyName().equals("lookAndFeel")) {
adjustFontSize(5);
}
}
});
before invoking the main method of the actual application.
However, if the font size is very small, it has likely been set explicitly, so changing the defaults might not help.