Solved

Making my JDesktopPane scrollable

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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 scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

636 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