• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Suppressing borders on a TextArea

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
anybody?
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Gideon Goodwin
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the information.
 
reply
    Bookmark Topic Watch Topic
  • New Topic