Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Making my JDesktopPane scrollable

Posted on 2003-11-17
2
Medium Priority
?
1,425 Views
Last Modified: 2007-12-19
Greetings.  I'm creating an application that takes an MDI approach, so I've implemented JDesktopPane and have created JInternalFrame's as the interior windows.  I'd like to make this scrollable so that when any of the interior windows is clipped, appropriate scroll-bars are displayed.  I've done some research on this, and from what I've seen most people accomplish this by creating a subclass of JDesktopPane (call it, say, JScrollableDesktopPane) and have this subclass implement the Scrollable interface.

Well, I've tried this, and I can't seem to get it to work.  I think I'm just unclear as to how I'm supposed to use this JScrollableDesktopPane once I've made an instance of it.  Here's what I'm currently trying, and is not working:

1) Create an instance of JScrollableDesktopPane (which is just JDesktopPane that implements Scrollable)
2) Create an instance of JScrollPane, passing my JScrollableDesktopPane in
3) Setting my main JFrame's content pane (setContentPane) to the instance of JScrollPane

Am I completely off here, or am I on the right track.  Any advice is greatly appreciated!

-Rick
0
Comment
Question by:slikrik98
2 Comments
 
LVL 9

Accepted Solution

by:
yongsing earned 1400 total points
ID: 9768249
Here's an article on how to add scroll bars to the desktop pane:

http://www.javaworld.com/javaworld/jw-05-2001/jw-0525-mdi.html
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question