This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes JScrollPane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JScrollPane" Watch "JScrollPane" New topic


Felipe Walker
Ranch Hand

Joined: Sep 23, 2003
Posts: 41
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"

Joined: Sep 29, 2000
Posts: 8521
Moved to the Swing Forum.

"JavaRanch, where the deer and the Certified play" - David O'Meara
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24195

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.

[Jess in Action][AskingGoodQuestions]
Felipe Walker
Ranch Hand

Joined: Sep 23, 2003
Posts: 41
Thanks, It works
I agree. Here's the link:
subject: JScrollPane
jQuery in Action, 3rd edition