View Single Post
  #2 (permalink)  
Old 08-05-2007, 08:26 AM
hardwired hardwired is offline
Senior Member
 
Join Date: Jul 2007
Posts: 1,222
hardwired is on a distinguished road
The GraphicsEnvironment class has a couple of handy methods you can use to get the fonts and their names.
Code:
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); Font[] fonts = ge.getAllFonts(); String[] names = ge.getAvailableFontFamilyNames();
is possible instead of text colors ..... to use colored lines in the choice... Is this possible?
I don't think you could do this in the AWT. I think you could in Swing by making a custom renderer for a JComboBox.
Usually, I would use an array of Colors and fetch the color using the selectedIndex of the Choice.

how i can change the color of a String? I have a String inside a TextArea
TextArea supports only a single color and font. For multiple colors and fonts you will need to use a JTextPane and a StyledDocument.
Reply With Quote