• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

How to set multiple fonts inJTextArea or JTextPane

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

Hi javalovers,
This is the first time am writin to javaranch.
My question is it possible to obtain multiple fonts in JTextArea or JTextPane .I have tried in JTextArea to find
that it supports only one font.Am currently working on a wordprocessing applet can anyone suggest me which component
would be suitable to get input text and also have multiple fonts.Something like i select one word from my sentence and
want that to be bold .So which swing component supports multiple fonts.
 
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Srini,
This might be overkill but take a look at the application below.

Enjoy,
Manfred.
 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Manfred ,
If there is an alignment menu and a image is placed in the textpane, does alignment work for image too..
(i.e if the user selects a line which has image and does right alignment whether the image too move along with it or only the text?)
thanks,
Regards,
silva.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic