Solved

Making my JDesktopPane scrollable

Posted on 2003-11-17
2
1,384 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
servlet example 11 76
Java Restore security prompts not working 10 261
maven disable workspace resolution 1 77
How does initial implicit objects  are set up in JSP? 7 40
In this post we will learn different types of Android Layout and some basics of an Android App.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

739 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