PageRenderTime 46ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/jEdit/tags/jedit-4-1-pre5/bsh/commands/setFont.bsh

#
Unknown | 19 lines | 15 code | 4 blank | 0 comment | 0 complexity | b375a8dbbb2df6b808bfe2ff8ef754d1 MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  1. /**
  2. Change the point size of the font on the specified component, to ptsize.
  3. This is just a convenience for playing with GUI components.
  4. */
  5. bsh.help.setFont = "usage: setFont( Component comp, int ptsize )";
  6. import java.awt.*;
  7. Font setFont( Component comp, int ptsize ) {
  8. font = comp.getFont();
  9. f = font.getFamily();
  10. s = font.getStyle();
  11. font = new Font( f, s, ptsize );
  12. comp.setFont( font );
  13. comp.validate();
  14. return font;
  15. }