Welcome to Gaia! ::

xXEmilyHatakeXx's avatar
  • 100
  • 100
  • 200
Hi there everyone, I hope I'm posting this in the right category.

Lately I've been teaching myself java for some research i'm doing and I've come across a snag I'm hoping someone can help me resolve.

Currently I'm drawing amino acids using drawline and drawstring, by using drawstring is there anyway to write using subscript?

Thanks a Bunch,
Emily
Sitwon's avatar
  • 50
  • 100
  • 150
Yes, it is possible.

You need to create an AttributedString and apply a TextAttribute (key: TextAttribute.SUPERSCRIPT, value: TextAttribute.SUPERSCRIPT_SUB) to the part that you want to be displayed as subscript. Then call getIterator() on the AttributedString to return an AttributedCharacterIterator which can be passed to drawString().

Edit: For future reference, this topic belongs in the main C&T board, not in Tech-Talk.

Quick Reply

Submit
Manage Your Items
Other Stuff
Get Items
Get Gaia Cash
Where Everyone Hangs Out
Other Community Areas
Virtual Spaces
Fun Stuff