🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: aus.computers.java
6 messages
6 total messages Started by Michael Rowlands Fri, 02 Jul 1999 00:00
Easy TextArea problem PLEASE HELP
#1179
Author: Michael Rowlands
Date: Fri, 02 Jul 1999 00:00
16 lines
1391 bytes
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
Re: Easy TextArea problem PLEASE HELP
#1176
Author: Dave Postill
Date: Thu, 01 Jul 1999 00:00
24 lines
2036 bytes
[This followup was posted to comp.lang.java.gui, cc: the cited author, Michael Rowlands]

In article <930831978.803997@Chaos.es.co.nz>, on Fri, 2 Jul 1999 00:21:38 +1200, "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.

Use a JTextPane.

davep
--
Dave Postill                Investment Intelligence Systems Corp
Galaxy Support Leader               +44 (0) 171 628 6960 [voice]
<mailto:davep@iisc.co.uk>           +44 (0) 171 638 7528   [fax]
<mailto:dave.postill@pobox.com>          <http://www.iisc.co.uk>
Re: Easy TextArea problem PLEASE HELP
#1177
Author: George Burns
Date: Thu, 01 Jul 1999 00:00
17 lines
1582 bytes
I'm having a problem with a JTextPane in a JScrollPane.

We are using JDK1.1.7 with Swing 1.0 using JBuilder 2.0 Professional.

When the amount of text in the JTextPane gets large, scrolling down stops
too early.  You can then use the arrow keys to move the caret lower and
scroll down further, but it stops painting the new area, leaving it grey.

We never even get over 2K characters, so it isn't like we are taxing the
ability of the JTextPane.  Can someone help me out?

George



   -**** Posted from RemarQ, http://www.remarq.com/?c ****-
 Search and Read Usenet Discussions in your Browser
Re: Easy TextArea problem PLEASE HELP
#1178
Author: grifftor
Date: Thu, 01 Jul 1999 00:00
33 lines
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.
Re: Easy TextArea problem PLEASE HELP
#1180
Author: Philip Brown
Date: Fri, 02 Jul 1999 00:00
31 lines
1806 bytes
On Thu, 01 Jul 1999 23:41:18 GMT, grifftor@my-deja.com wrote:
>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));
>>...

>Try this
>
>textArea.getSelectedText().setFont(new Font(ari, Font.PLAIN, 12));
>

huh?
do try things out before you post them. 
That is equivalent to

"Heres a string".setFont(....);

and besides which, you can't have multiple fonts in a TextArea


-- 
[Trim the no-bots from my address to reply to me by email!]
[ Do NOT email-CC me on posts. Pick one or the other.]
 --------------------------------------------------
The word of the day is mispergitude
Re: Easy TextArea problem PLEASE HELP
#1185
Author: NIR
Date: Sun, 04 Jul 1999 00:00
25 lines
1531 bytes
Very easy answer, You can't do that with TextArea.

Michael Rowlands <michaelrowlands@bigfoot.com> wrote in message
news:930831978.803997@Chaos.es.co.nz...
> 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
>
>
>
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads