Solved

Making my JDesktopPane scrollable

Posted on 2003-11-17
2
1,364 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 350 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…

914 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now