Link to home
Start Free TrialLog in
Avatar of tuckkhai
tuckkhai

asked on

Setting font of the celleditor in JTable

Does anyone know how to set the font of the default editor in the JTable?
Please help....
Thanks
Avatar of tuckkhai
tuckkhai

ASKER

urgent
ASKER CERTIFIED SOLUTION
Avatar of bfarrell
bfarrell

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mick Barry
Try setting the font used by the table.
If this doesn't have the desired effect, then you will proabky need to supply your own custom cell editor.
JTable table = new JTable ( .... ) ;
table.setFont ( new Font ( "FontName", Font.STYLE, <size> ) ) ;

"FontName" can be "Default", or "TimesRoman", or one of the available fonts. The STYLE can be BOLD, or PLAIN, or ITALIC, or combined as Font.BOLD | Font.ITALIC. The size should be an integer (try 12 or something close to it).

Mayank.