aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Suppressing borders on a TextArea Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Suppressing borders on a TextArea" Watch "Suppressing borders on a TextArea" New topic
Author

Suppressing borders on a TextArea

Gideon Goodwin
Greenhorn

Joined: Dec 10, 2004
Posts: 13
Hello, hopefully this should be an easy question to answer:

I have added a TextArea to a custom Panel subclass and I would like it to display its text contents without drawing standard AWT borders. I looked at the API and couldn't find any suitable methods for supressing border-draw in either the TextArea, TextComponent, or Component classes. What is the easiest way to accomplish this? Even if I could set the border to a fixed color to match my background color...

Thanks in advance.
Rachel Swailes
Ranch Hand

Joined: May 18, 2004
Posts: 434
Hi there

If you were using swing components, you can use
myComponent.setBorder(BorderFactory.createEmptyBorder()) which would blank out the border.

Are AWT components a requirement?

Cheers,
Rachel
[ April 06, 2005: Message edited by: Rachel Swailes ]
Gideon Goodwin
Greenhorn

Joined: Dec 10, 2004
Posts: 13
Thanks for the reply.

We had been hoping to avoid Swing components because we are still trying to target Java2 without the swing extension. So can I infer from your post that it is not possible to supress borders on AWT TextAreas? If so, I can look for another solution.

Thanks again.
Gideon Goodwin
Greenhorn

Joined: Dec 10, 2004
Posts: 13
anybody?
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Well, with AWT the problem becomes what is supported by the OS. When you draw a textarea with AWT you are just requesting the native OS to display it's TextArea widget. So I would say you are out of luck.


GenRocket - Experts at Building Test Data
Gideon Goodwin
Greenhorn

Joined: Dec 10, 2004
Posts: 13
Thanks for the information.
 
 
subject: Suppressing borders on a TextArea