PageRenderTime 27ms CodeModel.GetById 24ms app.highlight 1ms RepoModel.GetById 1ms 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
 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
 6bsh.help.setFont = "usage: setFont( Component comp, int ptsize )";
 7
 8import java.awt.*;
 9
10Font setFont( Component comp, int ptsize ) {
11    font = comp.getFont();
12    f = font.getFamily();
13    s = font.getStyle();
14    font = new Font( f, s, ptsize );
15    comp.setFont( font );
16	comp.validate();
17    return font;
18}
19