home *** CD-ROM | disk | FTP | other *** search
/ Freelog Special Freeware 25 / FreelogHS25.iso / Dessin / ArtOfIllusion2.2.1 / ArtOfIllusion.jar / bsh / commands / setFont.bsh < prev    next >
Text File  |  2005-05-23  |  655b  |  26 lines

  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.  
  6. bsh.help.setFont = "usage: setFont( Component comp, int size )";
  7.  
  8. Font setFont(Component comp, String family, int style, int size) {
  9.         
  10.     this.font = comp.getFont();
  11.     
  12.     this.family = (family==null) ? font.family : family;
  13.     this.style = (style==-1) ? font.style : style;
  14.     this.size = (size==-1) ? font.size : size;
  15.     
  16.     font = new Font(family, style, size);
  17.     comp.setFont(font);
  18.     comp.validate();
  19.     return font;    
  20. }
  21.  
  22. Font setFont(Component comp, int size) {
  23.     return setFont(comp, null, -1, size);
  24. }
  25.  
  26.