Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

rtf file in netbeans??

 
Prasi Ram
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everybody,

I want to read a rtf file for my J2me application, the problem is when i read the file the words that has effects like bold and italic are displayed like " \b \i word \b\i" . Is there anyway to read a rtf file properly to mob application. Please help me.. My IDE is Netbeans 6.9.

Thanks in advance
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems that the contents of the file are displayed as text, without the RTF markup being interpreted properly. Are you certain that whatever component you're using to display the text can handle RTF?

(By the way, NetBeans is an IDE - it has no bearing on what happens at runtime.)
 
Prasi Ram
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello Lester Burnham,
Iam reading normally using file, fileInputstream things and putting them to Vector.. I dont know is this the right answer for your question..
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is important is not so much how the file is read, but how it is displayed. Does the view component understand what RTF is, and how to display it? Personally, I would be surprised if one of the standard JME API components can display RTF (I'm assuming you're using standard JME classes, since you don't mention using anything else).
 
Darryl Burke
Bartender
Posts: 5148
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would be surprised if any Java ME Item has the capability to display formatted text.
 
Prasi Ram
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the responses.. Actually even my self trying this for the first time. . I want to add some special characters and effects like(bold, italic ) to the text file which i have kept the contents.. So i thought y dont we go with RTF , so trying to implement

Lester Burnham, iam displaying the text items using normal graphics class drawstring functions, this time also I am not sure is this the right answer for your question
 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it does answer the question of whether you're using a component that can handle RTF. Unfortunately, the answer seems to be "no", so unless you find a component that knows about RTF -or implement one yourself- you're stuck.
 
Prasi Ram
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmmmm Let me try something else then..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic