This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma 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

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: 24189

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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: JScrollPane
It's not a secret anymore!