🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #11367

subscript / superscript in JTextPane?

#11367
From: Roman Huerlimann
Date: Thu, 03 Jun 1999 00:00
19 lines
1033 bytes
Hi

How is it possible to subscript / superscript some text? My closeset
approch til now is:

  SimpleAttributeSet attrs = new SimpleAttributeSet();
  StyleConstants.setSuperscript(attrs, true);
  textPane.getStyledDocument().setCharacterAttributes(1, 1, attrs,
true);

In my understanding this should make the second Character smaller and
paint it higher, but it only makes the Character smaller, it isn't
painted higher. I've got the same result with subscript.

Has anybody an idea?

Thanks.

Roman
Technical Details
Message-ID: <37568478.D38D3DE3@tamedia.ch>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,a21ae235b8bf8619,start
X-Google-Attributes: gid111d45,public
From: Roman Huerlimann <Roman.Huerlimann@tamedia.ch>
Subject: subscript / superscript in JTextPane?
Date: 1999/06/03
Message-ID: <37568478.D38D3DE3@tamedia.ch>
X-Deja-AN: 485241799
Content-Transfer-Encoding: 7bit
Organization: EUnet AG
X-Accept-Language: de-CH,en
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing