Java Swing JEditorPane
JEditorPaneÌṩÈýÖÖÀàÐ͵ÄÎı¾ÏÔʾ£¬text/plain,text/html,text/rtf.
JEditorPaneµÄ¼òµ¥Ó÷¨DEMOÈçÏ£º
package ibees.swing;
import java.awt.Toolkit;
import java.io.IOException;
import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
/**
* JEditorPaneÖ§³Ötext/html,text/plain,text/rtfÄÚÈÝÏÔʾ
* ´ËDemoÖ÷ҪչʾÁËJEditorµÄÓ÷¨ºÍJFrameÈ«ÆÁµÄ·½·¨
* @author hhzxj2008
* */
public class JEditorPaneSample {
/**
* ÔÚJEditorÖÐÏÔʾHTML
* @param args
* @throws IOException
*/
public static void main(String[] args) throws IOException {
JFrame jf = new JFrame("JEditorPaneʾÀý");
//text/htmlÎı¾ÀàÐÍ
final JEditorPane jep = new JEditorPane("http://csdn.net");
JScrollPane jsp = new JScrollPane(jep);//Ìí¼Ó¹ö¶¯Ö§³Ö
jep.addHyperlinkListener(new HyperlinkListener() {//Ìí¼ÓÁ´½Óµã»÷¼àÌýÕß
@Override
public void hyperlinkUpdate(HyperlinkEvent e) {
if(e.getEventType() == HyperlinkEvent.EventType.ACTIVATED){
try {
jep.setPage(e.getURL());//ÉèÖÃÏÔʾµÄURL×ÊÔ´
} catch (IOException e1) {
e1.printStackTrace();
}
}
}
});
jf.add(jsp);
jf.setSize(Toolkit.getDefaultToolkit().getScreenSize().getSize());//´°¿ÚÈ«ÆÁ
jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jf.setVisible(true);
}
}
Ïà¹ØÎĵµ£º
ÔÎÄÇë¿´
http://www.ibm.com/developerworks/cn/websphere/techjournal/0701_botzum/0701_botzum.html
ºóÐøÎÒ»á¶ÔÏÂÃæÌáµ½µÄ19µã½øÐÐһЩÊʵ±µÄÅú×¢,ËãÊÇ×Ô¼ºµÄ¶ÁÊé±Ê¼Ç
ÒýÑÔ
ÔÚ¹ýÈ¥µÄ¼¸ºõÕûÕûÊ®ÄêÖУ¬ÈËÃDZàдÁ˺ܶàÓÐ¹Ø Java™ Platform, Enterprise Edition (Java EE) ×î¼Ñʵ¼ùµÄÄÚÈÝ¡£ÏÖÔÚÓÐÊ®¶à±¾Êé¼®ºÍÊý ......
1. ʼÖÕʹÓà MVC ¿ò¼Ü¡£
½«ÒµÎñÂß¼£¨Java Bean ºÍ EJB ×é¼þ£©´Ó¿ØÖÆÆ÷Âß¼£¨Servlet/Struts ²Ù×÷£©ºÍ±íʾÂß¼£¨JSP¡¢XML/XSLT£©ÖÐÇåÎúµØ·ÖÀë³öÀ´¡£Á¼ºÃµÄ·Ö²ã¿ÉÒÔ´øÀ´Ðí¶àºÃ´¦¡£
×¢:¶ÔÓÚһЩСÐ͵ĻòÕßÒµÎñÏà¶Ô¼òµ¥µÄϵͳ¶øÑÔ,Óÿò¼Ü¿ª·¢²¢²»ÄÜ´øÀ´ÈκÎЧÒæ,²¢ÇÒÎÒÉîÐÅÔÚһЩÏîÄ¿¿ª·¢ÖÐ,ÌرðÊǽö½öÓÉij¸öÈ˶ÀÁ ......
KeywordFilter.java:
import java.io.InputStream;
import java.util.Enumeration;
import java.util.Properties;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class KeywordFilter
{
private static Pattern pattern = null;
private static KeywordFilter filter = new KeywordF ......
public class Multiplication
{
public static void main(String[] args)
{
// TODO Auto-generated method stub
for(int i = 1; i < 10; i+ ......