Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JScrollPane

 
Felipe Walker
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why won't the JScrollPane work. I know I am missing something but just keep overlooking it.

[ October 02, 2003: Message edited by: Cindy Glass ]
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the Swing Forum.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

c.add(scroller, BorderLayout.CENTER);
c.add(display_area, BorderLayout.CENTER);

First you add the JScrollPane containing the JTextArea to the window (correct) and then you add the bare JTextArea itself in the same position, effectively removing the JScrollPane from the window (wrong.) Just delete the second line above.
 
Felipe Walker
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, It works
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic