Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change font size in Eclipse for Java text editors?

I have just tried to change my font size in Eclipse 3.6.0 in the following way:

General → Appearance → Colors and Fonts → Java Editor text font

However, the font size only changed in the file I had open. How can I change the font size for all Java files and projects I open in Eclipse?

like image 511
Venkat Avatar asked Feb 07 '11 14:02

Venkat


People also ask

How do I change font size in Eclipse?

Go to Preferences > General > Appearance > Colors and Fonts, expand the "Basic" folder and select "Text Font" and change that to whatever size you like. Show activity on this post. Restart Eclipse to apply changes.

How do I change the text editor in Eclipse?

You can set which Eclipse editor or external program to use to open a specific type of file based on its file extension. Just select Window→ Preferences→ Workbench→ File Associations, select the file type, and associate an editor or program with it (if nothing else, you can use Eclipse's default text editor).

How do you change font size in Java?

You can't actually change the size of an existing Font object. The best way to achieve a similar effect is to use the deriveFont(size) method to create a new almost identical Font that is a different size. Note: you need to specify that bigNumber is a float, otherwise you'll trigger the deriveFont(int style) overload.


1 Answers

If you are changing the font size, but it is only working for the currently open file, then I suspect that you are changing the wrong preferences.

  • On the Eclipse toolbar, select WindowPreferences
  • Set the font size, GeneralAppearanceColors and FontsJavaJava Editor Text Font).
  • Save the preferences.

Check that you do not have per-project preferences. These will override the top-level preferences.

Eclipse v4.2 (Juno) note

Per comment below, this has moved to the Eclipse Preferences menu (no longer named the Window menu).

Eclipse v4.3 (Kepler) note

The Window menu is live again, that is, menu WindowPreferences.

Note Be sure to check out the ChandraBhan Singh's answer, it shows the key bindings to change the font size.

like image 187
DwB Avatar answered Sep 30 '22 18:09

DwB