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
Please help....
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
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.
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.
ASKER