Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

java HTMLÎļþÎĵµ±à¼­Æ÷ ʹÓà JTextPane

 java HTMLÎļþÎĵµ±à¼­Æ÷ ʹÓà JTextPane 
/* HTMLDocumentEditor.java
* @author: Charles Bell
* @version: May 27, 2002
*/
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.filechooser.*;
import javax.swing.text.*;
import javax.swing.text.html.*;
import javax.swing.undo.*;
/**HTMLÎļþÎĵµ±à¼­Æ÷*/
public class HTMLDocumentEditor extends JFrame implements ActionListener
{
 /** ÉùÃ÷Ò»¸öÍøÒ³Îĵµ¶ÔÏó±äÁ¿*/
 private HTMLDocument document;
 /** ´´½¨Ò»¸öÎı¾±à¼­°å*/
 private JTextPane textPane = new JTextPane();
 private boolean debug = false;
 /** ÉùÃ÷Ò»¸öÎļþ¶ÔÏó±äÁ¿*/
 private File currentFile;
 
 /** ÕìÌýÔÚµ±Ç°ÎĵµÉϵı༭Æ÷ */
 protected UndoableEditListener undoHandler = new UndoHandler();
 
 /** Ìí¼Ó³·Ïû¹ÜÀíÆ÷ */
 protected UndoManager undo = new UndoManager();
 
 /** Ìí¼Ó³·ÏûÕìÌýÆ÷*/
 private UndoAction undoAction = new UndoAction();
 /** Ìí¼Ó»Ö¸´ÕìÌýÆ÷*/
 private RedoAction redoAction = new RedoAction();
 
 /** Ìí¼Ó¼ôÇÐÕìÌýÆ÷*/
 private Action cutAction = new DefaultEditorKit.CutAction();
 /** Ìí¼Ó¸´ÖÆÕìÌýÆ÷*/
 private Action copyAction = new DefaultEditorKit.CopyAction();
 /** Ìí¼ÓÕ³ÌùÕìÌýÆ÷*/
 private Action pasteAction = new DefaultEditorKit.PasteAction();
 
 /** Ìí¼Ó¼Ó´ÖÕìÌýÆ÷*/
 private Action boldAction = new StyledEditorKit.BoldAction();
 /** Ìí¼Ó¼ÓÏ»®ÏßÕìÌýÆ÷*/
 private Action underlineAction = new StyledEditorKit.UnderlineAction();
 /** Ìí¼ÓÇãбÕìÌýÆ÷*/
 private Action italicAction = new StyledEditorKit.ItalicAction();
 
 private Action insertBreakAction = new DefaultEditorKit.InsertBreakAction();
 private HTMLEditorKit.InsertHTMLTextAction unorderedListAction = new HTMLEditorKit.InsertHTMLTextAction("Bullets", "<


Ïà¹ØÎĵµ£º

JavaʵÏÖĿ¼²éÕÒÓëÎı¾ÔĶÁ

 1.ʵÏÖÎı¾ÔĶÁ
package AllAboutFile;
/**
 *
 * @author lucifer
 */
import java.awt.*;
import java.awt.event.*;
import java.io.*;
public class FileViewer extends Frame implements ActionListener{
     String directory;
     Text ......

java·´Éä³£¼û·½·¨

»ñÈ¡classÀà·½·¨£º
1£¬getClass 2£¬Class.forName() 3,ÓÃ.class
public Field[] getDeclaredFields()
·µ»ØµÄÊÇij¸öÀàÀïµÄËùÓÐÀàÐ͵ıäÁ¿£¬²»°üÀ¨¼Ì³Ð¸¸ÀàµÄ
public Field[] getDeclaredFields(String name)
·µ»ØÌض¨Ãû×Ö
public Field[]  getFields()
·µ»ØµÄÊÇij¸öÀàÀïµÄËùÓÐpublicÀàÐ͵ıäÁ¿£¬°üÀ¨¼Ì³Ð¸¸Àൠ......

java¹ýÂËÆ÷¶ÔextÒì²½ÇëÇóÌø×ª

 1.java¹ýÂËÆ÷¶ÔextÒì²½ÇëÇóÌø×ª
Óû§·ÃÎʳ¬Ê±
½â¾öÁ½ÖÖÇé¿öϵÄÓû§·ÃÎʳ¬Ê±¡£
a£©ÆÕͨhttpÇëÇóµÄsession³¬Ê±¡£
b£©Òì²½httpÇëÇóµÄsession³¬Ê±£¬Ê¹ÓÃextºó´ó²¿·ÖµÄ½çÃæË¢Ð¶¼ÊÇÒì²½µÄajaxÇëÇó¡£
²»¹ÜÊÇÄÇÖÖÀàÐ͵ÄhttpÇëÇó×ÜÊÇ¿ÉÒÔÓÉÒ»¸ö¹ýÂËÆ÷À´²¶×½¡£
·ÖÀࣺÆÕͨhttpÇëÇóµÄheader²ÎÊýÖÐûÓÐx-requested-with: ......

javaÎļþ²Ù×÷

 1.´´½¨Îļþ¼Ð 
File myFolderPath = new File(%%1); 
try { 
if (!myFolderPath.exists()) { 
     myFolderPath.mkdir(); 


catch (Exception e) { 
System.out.println("н¨Ä¿Â¼²Ù×÷³ö´í"); 
e.printStackTrace();  ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ