Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java SE 综合讨论区  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
话题被移动
该话题已被移动 - littledeer1974 , 2004-10-29 10:40
如果您尚不清楚该话题被移动的原因,请参考论坛规则以及本版公告或者联系本版版主。
作者 那位大侠用JAVA开发过RTF文档编辑?
jameszhang



CJSDN高级会员


发贴: 1594
积分: 111
于 2004-03-09 15:30 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list



"First they ignore u, then they laugh at u, then they fight u, then u will win

Mahatma Gandhi"

作者 Re:那位大侠用JAVA开发过RTF文档编辑? [Re:jameszhang]
hohaischooldays





发贴: 112
积分: 10
于 2004-03-10 10:10 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
RTF指什么东东??


作者 Re:那位大侠用JAVA开发过RTF文档编辑? [Re:hohaischooldays]
jameszhang



CJSDN高级会员


发贴: 1594
积分: 111
于 2004-03-10 15:43 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
hohaischooldays wrote:
RTF指什么东东??

是一种标准的文档格式



"First they ignore u, then they laugh at u, then they fight u, then u will win

Mahatma Gandhi"

作者 Re:那位大侠用JAVA开发过RTF文档编辑? [Re:hohaischooldays]
tier3





发贴: 228
积分: 120
于 2004-03-10 16:00 user profilesend a private message to usersend email to tier3search all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Rich Text Format, 应该是doc文档的前身。


作者 Re:那位大侠用JAVA开发过RTF文档编辑? [Re:jameszhang]
hohaischooldays





发贴: 112
积分: 10
于 2004-03-10 17:39 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
那就和导出word 一样了,我只做过excel导出,你不妨说的详细一点,大家讨论一下!


作者 Re:那位大侠用JAVA开发过RTF文档编辑? [Re:jameszhang]
jameszhang



CJSDN高级会员


发贴: 1594
积分: 111
于 2004-03-10 19:09 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我想做个简单RTF编辑器,嵌入我的系统,有没有做过的给点资料,或者对RTF格式熟的,给介绍一下,我只知道他是一种所见即所得的文档格式,不知道JAVA支持到什么样,有没有用过的呢?


"First they ignore u, then they laugh at u, then they fight u, then u will win

Mahatma Gandhi"

作者 Re:那位大侠用JAVA开发过RTF文档编辑? [Re:jameszhang]
gunrose





发贴: 100
积分: 20
于 2004-03-11 11:39 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
好像网上有现成的jar可以用的,我见其他人使用过。去找找看。


作者 Re:那位大侠用JAVA开发过RTF文档编辑? [Re:jameszhang]
hotyaya





发贴: 101
积分: 0
于 2004-03-11 22:09 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
是的,同意楼上,我见过


作者 Re:那位大侠用JAVA开发过RTF文档编辑? [Re:jameszhang]
jameszhang



CJSDN高级会员


发贴: 1594
积分: 111
于 2004-03-12 08:14 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我找了,没有有价值的,不知道你们在那里看到的?


"First they ignore u, then they laugh at u, then they fight u, then u will win

Mahatma Gandhi"

作者 Re:那位大侠用JAVA开发过RTF文档编辑? [Re:jameszhang]
archonLing





发贴: 57
积分: 10
于 2004-03-12 09:33 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
Try apache project's XML-FOP. If you are interested in using XML to render text. Or you can play with javax.swing.text.rtf, it has some rtfrender methods. Have fun!


作者 Re:那位大侠用JAVA开发过RTF文档编辑? [Re:jameszhang]
tzutolin



版主


发贴: 581
积分: 65
于 2004-03-12 09:49 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
jameszhang wrote:
我想做个简单RTF编辑器,嵌入我的系统,有没有做过的给点资料,或者对RTF格式熟的,给介绍一下,我只知道他是一种所见即所得的文档格式,不知道JAVA支持到什么样,有没有用过的呢?


Hi, JamesZhang

Java 中對於 RTF 的支援非常完整!

很久之前曾經寫過一個 RTF 的編輯器, 但卻忘了把源碼留下來, 我再找找看, 如果找到的話在貼上來跟大家分享!

這裡有一段程式碼可以顯示 RTF, 請您參考一下, 希望對您有幫助:


import java.awt.*;
import java.io.*;
import javax.swing.*;
import javax.swing.text.*;
import javax.swing.text.rtf.*;

class RTFView
    extends   JFrame
{
  public RTFView()
  {
    setTitle( "RTF Text Application" );
    setSize( 400, 240 );
    setBackground( Color.gray );
    getContentPane().setLayout( new BorderLayout() );

    JPanel topPanel = new JPanel();
    topPanel.setLayout( new BorderLayout() );
    getContentPane().add( topPanel, BorderLayout.CENTER );

    // Create an RTF editor window
    RTFEditorKit rtf = new RTFEditorKit();
    JEditorPane editor = new JEditorPane();
    editor.setEditorKit( rtf );
    editor.setBackground( Color.white );

    // This text could be big so add a scroll pane
    JScrollPane scroller = new JScrollPane();
    scroller.getViewport().add( editor );
    topPanel.add( scroller, BorderLayout.CENTER );

    // Load an RTF file into the editor
    try {
      FileInputStream fi = new FileInputStream( "test.rtf" );
      rtf.read( fi, editor.getDocument(), 0 );
    }
    catch( FileNotFoundException e )
    {
      System.out.println( "File not found" );
    }
    catch( IOException e )
    {
      System.out.println( "I/O error" );
    }
    catch( BadLocationException e )
    {
    }
  }

  public static void main( String args[] )
  {
    // Create an instance of the test application
    RTFView mainFrame  = new RTFView();
    mainFrame.setVisible( true );
  }
}



Best regards,
tzutolin



作者 Re:那位大侠用JAVA开发过RTF文档编辑? [Re:jameszhang]
jameszhang



CJSDN高级会员


发贴: 1594
积分: 111
于 2004-03-12 10:46 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
java.swing.tetx.rtf 好象支持的不是很好?最重要的是图象不能显示!!!!

(缩略图,点击图片链接看原图)


jameszhang edited on 2004-03-12 11:44

"First they ignore u, then they laugh at u, then they fight u, then u will win

Mahatma Gandhi"

作者 Re:那位大侠用JAVA开发过RTF文档编辑? [Re:jameszhang]
tzutolin



版主


发贴: 581
积分: 65
于 2004-03-12 13:37 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
jameszhang wrote:
java.swing.tetx.rtf 好象支持的不是很好?最重要的是图象不能显示!!!!

應該可以顯示的, 請再找找相關的源碼看看!

Best regards,
tzutolin



作者 Re:那位大侠用JAVA开发过RTF文档编辑? [Re:jameszhang]
jameszhang



CJSDN高级会员


发贴: 1594
积分: 111
于 2004-03-12 14:05 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
研究.........,呵呵


"First they ignore u, then they laugh at u, then they fight u, then u will win

Mahatma Gandhi"


flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923