• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JTextPane , StyledDocument

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I developing a chatter application, I used JTexPane with StyledDocument. And i am inserting string with timestamp in to StyledDocument like below

[22/04/2009 15:22]nathan: hai
[22/04/2009 15:22]nathan: how ru
[22/04/2009 15:22]nathan: i am fine

After that if i wish to hide/show time stamp means the textpane should be modified like

nathan: hai
nathan: how ru
nathan: i am fine

if i give show it should show again the same timestamp...
Is it possible..? if so can i have the logic or sample code...

I am using the code is


But there is no change in textpane.. please provide me the best way to get my requirement

Thanks
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What have you got so far?
 
Loganathan Subramani
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If i clicked hide button i m changing TimeStamp object to ""; but it didn't reflect in styledDoc


its used in yahoo chat window..... like time stamp show/hide option....
 
Maneesh Godbole
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please use code tags
http://faq.javaranch.com/java/UseCodeTags

When the user selects show / hide, where are you resetting/reloading the style doc?
 
Loganathan Subramani
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am resetting doc in public void setTimeStampVisible(boolean flag) method you can see my full code in my previous post itself..

 
Loganathan Subramani
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there any other option for dynamic content at text editor in swing program..? if so please suggest me.
 
reply
    Bookmark Topic Watch Topic
  • New Topic