Skip to main content

JXTextArea?

4 replies [Last post]
rbair
Offline
Joined: 2003-07-08

I'm proposing a JXTextArea class that would simply extend JTextArea, but defaults linewrap to true, and wrap style word to true.

Does anybody else out there *always* do this to their text areas?

If this isn't acceptable for JXTextArea, would a simple method in JNTextArea be better? Does anybody ever set linewrap to true, and wrap style word to false?

By the way, I'd call the method "wordWrap" in JNTextArea.

Richard

BTW, I only have the swingx code, hopefully I'm not covering ground that's already been trod...

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
rameshgupta
Offline
Joined: 2004-06-04

> I'm proposing a JXTextArea class that would simply
> extend JTextArea, but defaults linewrap to true, and
> wrap style word to true.
>
> Does anybody else out there *always* do this to their
> text areas?

Yes! I do :-)

>
> If this isn't acceptable for JXTextArea, would a
> simple method in JNTextArea be better? Does anybody
> ever set linewrap to true, and wrap style word to
> false?

You mean, set linewrap to false? I almost never do.

>
> By the way, I'd call the method "wordWrap" in
> JNTextArea.
>
> Richard

Me too!

But, I agree with Gilles that subclassing JTextArea just to change these defaults is a weak case :-)

Ramesh

rbair
Offline
Joined: 2003-07-08

> But, I agree with Gilles that subclassing JTextArea
> just to change these defaults is a weak case :-)

Well, then, a candidate for JNTextArea for sure.

Patrick Wright

Rich

Just a thought--would it make sense to RFE for Swing components
externalize some of their default behaviors and make it changeable through
a Preferences instance? Meaning that one could provide a Preferences
instance for all new JTextAreas to read these values on
instantiation--rather than subclassing.

-Patrick

> I'm proposing a JXTextArea class that would simply extend JTextArea, but
> defaults linewrap to true, and wrap style word to true.
>
> Does anybody else out there *always* do this to their text areas?
>
> If this isn't acceptable for JXTextArea, would a simple method in
> JNTextArea be better? Does anybody ever set linewrap to true, and wrap
> style word to false?
>
> By the way, I'd call the method "wordWrap" in JNTextArea.
>
> Richard
>
> BTW, I only have the swingx code, hopefully I'm not covering ground that's
> already been trod...
> ---

---------------------------------------------------------------------
To unsubscribe, e-mail: jdnc-unsubscribe@jdnc.dev.java.net
For additional commands, e-mail: jdnc-help@jdnc.dev.java.net

gphilipp
Offline
Joined: 2003-06-10

Hmmm, my guess would be that a JNTextArea should suffice if it only has to customize a private JTextArea. A JXTextArea should see the light only in the case JTextArea is not powerful enough to accomplish something.

Gilles Philippart
Senior IT Consultant
Beijaflore