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", "<
Ïà¹ØÎĵµ£º
»ñÈ¡classÀà·½·¨£º
1£¬getClass 2£¬Class.forName() 3,ÓÃ.class
public Field[] getDeclaredFields()
·µ»ØµÄÊÇij¸öÀàÀïµÄËùÓÐÀàÐ͵ıäÁ¿£¬²»°üÀ¨¼Ì³Ð¸¸ÀàµÄ
public Field[] getDeclaredFields(String name)
·µ»ØÌض¨Ãû×Ö
public Field[] getFields()
·µ»ØµÄÊÇij¸öÀàÀïµÄËùÓÐpublicÀàÐ͵ıäÁ¿£¬°üÀ¨¼Ì³Ð¸¸Àൠ......
function createTreeMenu(){//´´½¨Ò»¸öÊ÷µÄÃæ°å
var treeMenu = new Ext.tree.TreePanel({
lines : true,
minSize : 150,
border : false,
root : new Ext.tree.AsyncTreeNode({text : 'root'}),
loader : new Ext.tree.TreeLoader({dataUr ......
/**
*
* @param par
* ÈëÁ¦Ãû
* @return ÈëÁ¦値
*/
public static String inputfromConsole(String par) {
System.out.println(par);
InputStreamReader ......
41¡¢ÊÇ·ñ¿ÉÒԼ̳ÐStringÀà?
StringÀàÊÇfinalÀà¹Ê²»¿ÉÒԼ̳С£
42¡¢swtichÊÇ·ñÄÜ×÷ÓÃÔÚbyteÉÏ£¬ÊÇ·ñÄÜ×÷ÓÃÔÚlongÉÏ£¬ÊÇ·ñÄÜ×÷ÓÃÔÚStringÉÏ?
switch£¨expr1£©ÖУ¬expr1ÊÇÒ»¸öÕûÊý±í´ïʽ¡£Òò´Ë´«µÝ¸ø switch ºÍ case Óï¾äµÄ²ÎÊýÓ¦¸ÃÊÇ int¡¢ short¡¢ char »òÕß byte¡£long,st ......
/**
* @author he
*
*
* °ÑDateת»»³ÉString£¬ÒÔyyyy-MM-dd HH:mm:ssµÄÐÎʽÏÔʾ
*/
public static String DateToString(Date tempDate) {
......