Article View: aus.computers.java
Article #1178Re: Easy TextArea problem PLEASE HELP
From: grifftor
Date: Thu, 01 Jul 1999 00:00
Date: Thu, 01 Jul 1999 00:00
33 lines
1733 bytes
1733 bytes
In article <930831978.803997@Chaos.es.co.nz>,
"Michael Rowlands" <michaelrowlands@bigfoot.com> wrote:
> Hi I am making a simple text editor and am trying to implemented a
font
> change when a user uses a drop down menu and selects the font i.e.
Arial the
> way I have it now is
>
> textArea.setFont(new Font(ari, Font.PLAIN, 12));
>
> // ari is defined by "private String ari = new String("Arial");"
>
> The program changes fonts but changes the whole textArea, when I only
want
> to change the user selection in the textArea.
>
> How do I do this?
>
> Many thanks
>
> Michael Rowlands
>
>
Try this
textArea.getSelectedText().setFont(new Font(ari, Font.PLAIN, 12));
-Grifftor
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Technical Details
Message-ID:
<7lguas$s7u$1@nnrp1.deja.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<930831978.803997@Chaos.es.co.nz>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10fd6d,da84d4e138b1e98f X-Google-Attributes: gid10fd6d,public X-Google-Thread: 10a146,da84d4e138b1e98f X-Google-Attributes: gid10a146,public X-Google-Thread: 10d6db,da84d4e138b1e98f X-Google-Attributes: gid10d6db,public X-Google-Thread: 113ae9,da84d4e138b1e98f X-Google-Attributes: gid113ae9,public From: grifftor@my-deja.com Subject: Re: Easy TextArea problem PLEASE HELP Date: 1999/07/01 Message-ID: <7lguas$s7u$1@nnrp1.deja.com> X-Deja-AN: 496182989 References: <930831978.803997@Chaos.es.co.nz> X-Http-Proxy: 1.1 x42.deja.com:80 (Squid/1.1.22) for client 161.7.224.152 Organization: Deja.com - Share what you know. Learn what you don't. X-Article-Creation-Date: Thu Jul 01 23:41:18 1999 GMT Newsgroups: aus.computers.java,comp.lang.java.gui,comp.lang.java.help,comp.lang.java.programmer X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 95)