/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
- /**
- Change the point size of the font on the specified component, to ptsize.
- This is just a convenience for playing with GUI components.
- */
- bsh.help.setFont = "usage: setFont( Component comp, int ptsize )";
- import java.awt.*;
- Font setFont( Component comp, int ptsize ) {
- font = comp.getFont();
- f = font.getFamily();
- s = font.getStyle();
- font = new Font( f, s, ptsize );
- comp.setFont( font );
- comp.validate();
- return font;
- }