Article View: aus.computers.java
Article #1172Getting a TextArea's font and font size
From: Michael Rowlands
Date: Mon, 28 Jun 1999 00:00
Date: Mon, 28 Jun 1999 00:00
23 lines
1638 bytes
1638 bytes
Hi,
How do you capture the font, size and style of a TextArea?
I have tried
if (cmd.equals(fontPlain))
{
// returns String representing the logical name of the Font.
String fontAtChange = textArea.getName();
textArea.setFont(new Font(fontAtChange, Font.PLAIN, 20));
textArea.setText(fontAtChange);
}
However it just gives me "text0" instead of my default which I defined as
textArea.setFont(new Font(cou, Font.PLAIN, 12));
// cou is defined as "fontLogicalName.add(new MenuItem(cou));" which in turn
is taken from
"private String cou = new String("Courier");"
Can anybody Help I am desperate
Cheers
Michael Rowlands
michaelrowlands@bigfoot.com
Technical Details
Message-ID:
<930570833.35860@Chaos.es.co.nz>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10a146,546c529b3dd8f85,start X-Google-Attributes: gid10a146,public X-Google-Thread: 113ae9,546c529b3dd8f85,start X-Google-Attributes: gid113ae9,public X-Google-Thread: 10d6db,546c529b3dd8f85,start X-Google-Attributes: gid10d6db,public X-Google-Thread: 10fd6d,546c529b3dd8f85,start X-Google-Attributes: gid10fd6d,public From: "Michael Rowlands" <michaelrowlands@bigfoot.com> Subject: Getting a TextArea's font and font size Date: 1999/06/28 Message-ID: <930570833.35860@Chaos.es.co.nz> X-Deja-AN: 494734513 Cache-Post-Path: Chaos.es.co.nz!unknown@p47-max7.dun.ihug.co.nz Organization: The Internet Group (Dunedin) X-MSMail-Priority: Normal X-Priority: 3 X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/) X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Newsgroups: aus.computers.java,comp.lang.java.gui,comp.lang.java.help,comp.lang.java.programmer