• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Need Help Please!

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
store "bold","italic" infomation seperatly in the DB and retrive them when you desplaying them and show them accordingly.
 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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();
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't MAKE me come back there with this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic