Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Disabling JTextArea border  RSS feed

 
Richard Everhart
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to add some possibly lengthy text to a component that will have to contain new lines. I would like to use a JTextArea to do this but can't seem to find a way to disable its border. I know this is possible because I've done this before but I can't recall how (!) Any assistance would be much appreciated.

Rich
 
David Weitzman
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
setBorder(BorderFactory.createEmptyBorder()), perhaps?
 
Richard Everhart
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, I got it: just call setOpaque(false) on a new JTextArea.

Rich
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!