哪位能在这个java记事本中添加字体设置选项功能?

来源:百度知道 编辑:UC知道 时间:2024/05/21 15:08:05
代码如下:
最好能调用系统的字体设置(满意再加50分)
JTextArea fileArea=new JTextArea(); //定义一个显示纯文本的多行区域。
public static void main(String arg[]) //主函数入口
{
Note nt=new Note();
nt.show();
}
public Note()
{
super("记事本");
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); //取消关闭窗口的默认操作
addWindowListener(new WindowAdapter() //调用exit响应关闭按钮
{
public void windowClosing(WindowEvent e)
{
exit();
}
});
menuFileOpen.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
fileOpen_actionPerformed(e);
}
});
menuFileSave.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
fileSave_actionPerformed(e);
}
});

GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
JList fontNames = new JList(ge.getAvailableFontFamilyNames());
Object selectedFont = fontNames.getSelectedValue();

我这有 以前 做的 记事本(实现了 MVC 基本和 notpad功能一样) . 要的话说一声

哪里有代码?

调用系统字体可以参考j2se的demo,去sun公司里找