• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need Help Please!

 
Manjit Barman
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am writting an application using Swing Components.
I have a JTextPane, some buttons "Bold", "Italic". The text in the JTextPane should be able to be modified to Bold/Italic when i click the Bold or ITalic Button and then i am storing the Bold/Italic text that is in the JTextPane into an Oracle 9i Database. I know its going to be stored as a String.
Now, I want retrieve the same data and display with BOLD or Italic (The same way it has been modified before storing into DB). can anyone tell me the way to do that?
It would be really appraciable!
Thanks!
 
Mudi Appu
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
store "bold","italic" infomation seperatly in the DB and retrive them when you desplaying them and show them accordingly.
 
Lionel Badiou
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Manjit,

You might try to store your text in html format.

Hope that helps,
 
Manjit Barman
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Kanishtha
Could you please tell me little more about how to store them separately in DB or show some code if possible? That would be really great!


Hi
Lionel Badiou
Initially i tried storing in html format with JSP form but when i dispaly them it shows up all <p>, <b>, <i> etc which i don't want to show to the user.

Anyway, Thanks a lot both of you for your suggestion.
[ April 26, 2005: Message edited by: Manjit Barman ]
 
Manjit Barman
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found the solution.
Thanks a lot everyone!
 
Mudi Appu
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please be kind enough to post your solution here. It may helpful for others.
Cheers
 
Manjit Barman
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kanishtha,
Sorry, i was busy, didn't get a chance to log in.
Anyway, The solution is
call the style document from the TextPane and store in the DB.
Document doc=jTextPane1.getStyledDocument();
 
Alvin Kain
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Manjit, you store the whole document into the database ?
You store them as a Char field ? or what type of field for the database did you use?

Thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!