单项选择题

Swing组件提供的设置字体的方法是:()

A. setBorder
B. setFont
C. setForeground
D. setPreferredFont