• 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/line spacing.

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Friends,
I like to have a help from u people.
I have a content such as
<html><body>This is first line<br>This is second line</body></html>
I set the text to JTextPane.In which i need is the distance between the first & second line should be set by explicitly by me.
For eg:The output wuld be like this
This is first line.
This is second line.
Will i be able to set the distance between 2 lines in JTextPane if so how could it be possible.
Excepting u'r reply,
Thanks & Regards,
Nivi.
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check out this article on O'Reilly's website... look in the paragraph about "Paragraph and Character Styles"... the method you are looking for is StyleConstants.setLineSpacing( MutableAttributeSet a, float i ); and this article shows an example of how to use it.
 
nivedita rajiv
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Nate,
Thanks for u'r response.I was just happy to see u'r response.This is what i needed from u'r reply.I went thro' the link u gave & also did a sample application & also did the downloaded that source & runned but all reflects except the setLineSpacing alone doesn't work which is very much I'm needed. Culd u pl.. help me out in this regard.
Eagerly excepting u'r reply.Pl help me out in this regard such that setline spacing works out in jtextpane.
I wuld explain y i need this.Ihave a jtextpane in which i ahve contents the line spacing for jdk1.4 version is less but for jdk 1.3 its more than jdk1.4 which makes my content out of jtextpane but which culd be accomodated in jtextpane in jdk1.4 version.
Pl.. help me out in this regard.
Regards,
Nivi.
 
reply
    Bookmark Topic Watch Topic
  • New Topic