Java记事本
各位大哥,大姐们! 
             我想问一下如何用javax.swing编一个记事本里的字体设置功能,还有替换功能,我想了好久也没有想到,希望大家帮我一下。
------解决方案--------------------swing中有控件JEditorPane这个可以. 
 而且JAVA的安装目录下有记事本的例子程序 
------解决方案--------------------JAVA 字体控件   
 import java.awt.Frame; 
 import javax.swing.JDialog; 
 import javax.swing.JPanel; 
 import javax.swing.JScrollPane; 
 import javax.swing.JTextArea; 
 import javax.swing.JLabel; 
 import java.awt.Rectangle; 
 import javax.swing.JTextField; 
 import javax.swing.JList; 
 import javax.swing.BorderFactory; 
 import javax.swing.border.Border; 
 import javax.swing.border.TitledBorder; 
 import java.awt.Color; 
 import javax.swing.JButton; 
 import java.awt.SystemColor; 
 import java.awt.GraphicsEnvironment; 
 import javax.swing.event.ListSelectionEvent; 
 import javax.swing.event.ListSelectionListener; 
 import java.awt.event.*; 
 import javax.swing.event.*; 
 import java.awt.Font;   
 public class FrmFont 
     extends JDialog {   
   JLabel jLabel1 = new JLabel(); 
   JTextField txtFontFace = new JTextField(); 
   JLabel jLabel2 = new JLabel(); 
   JTextField txtFontStyle = new JTextField(); 
   JLabel jLabel3 = new JLabel(); 
   JTextField txtFontSize = new JTextField();   
   JPanel jPanel1 = new JPanel(); 
   Border border1 = BorderFactory.createEmptyBorder(); 
   Border border2 = new TitledBorder(border1,  "事例 "); 
   JButton btnOK = new JButton(); 
   JButton btnCancle = new JButton(); 
   JLabel lblDemo = new JLabel(); 
   Border border3 = BorderFactory.createLineBorder(SystemColor.controlText, 2); 
   JScrollPane jScrollPane1 = new JScrollPane(); 
   JScrollPane jScrollPane2 = new JScrollPane(); 
   JScrollPane jScrollPane3 = new JScrollPane(); 
   ///////////////////////////////////////// 
   JList lstFontFace; 
   JList lstFontStyle; 
   JList lstFontSize; 
   ///////////////////////////////////////// 
   ///////////////////////////////////////// 
   String curFontFace =  "宋体 "; 
   int curFontStyle = Font.PLAIN; 
   int curFontSize = 12;   
   Font font; 
   JTextArea txtArea; 
   //////////////////////////////////////// 
   public FrmFont(Frame owner, String title, boolean modal, JTextArea txtArea) { 
     super(owner, title, modal); 
     this.txtArea = txtArea; 
     try { 
       setDefaultCloseOperation(DISPOSE_ON_CLOSE); 
       jbInit(); 
       pack(); 
     } 
     catch (Exception exception) { 
       exception.printStackTrace(); 
     } 
   }   
   public FrmFont(Frame owner, JTextArea txtArea) { 
     this(owner,  "DialogFont ", true, txtArea);   
   }   
   private void jbInit() throws Exception { 
     //取得系统中所有的字体 
     GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment(); 
     String[] fontFaces = env.getAvailableFontFamilyNames(); 
     String[] fontStyle = { 
          "常规 ",  "斜体 ",  "粗体 "}; 
     String[] fontSize = { 
          "8 ",  "9 ",  "10 ",  "11 ",  "12 ",  "14 ",  "16 ",  "18 ",  "20 ",  "22 ",  "24 ",  "26 ", 
          "28 ",  "36 ",  "48 ",  "72 "}; 
     lstFontFace = new JList(fontFaces); 
     lstFontStyle = new JList(fontStyle); 
     lstFontSize = new JList(fontSize);   
     border2 = new TitledBorder(BorderFactory.createEtchedBorder(Color.white, 
         new Color(148, 145, 140)),  "示例 ");