Nick is right about RichText. Also check out CellUtil#setCellStyleProperty, which will avoid creating duplicate styles or unintentionally modifying other calls that share the same style. https://poi.apache.org/apidocs/org/apache/poi/ss/util/CellUtil.html#setCellStyleProperty(org.apache.poi.ss.usermodel.Cell,%20java.lang.String,%20java.lang.Object) On Jun 2, 2016 8:07 AM, "Nick Burch" <[email protected]> wrote:
> On Thu, 2 Jun 2016, janek.schroeder wrote: > >> I want to insert normal text and subscript/superscript (eg. CO2) in one >> excel cell. >> > > You want to use RichTextString functionality. See the docs for more: > http://poi.apache.org/spreadsheet/quick-guide.html#RichText > And also some examples, eg > > https://svn.apache.org/repos/asf/poi/trunk/src/examples/src/org/apache/poi/xssf/usermodel/examples/WorkingWithRichText.java > > Nick > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
