Viewing all of a JPanel

I have been trying to find a way to be able to view an entire JPanel that may not fit into the window size. I currently have one big panel that has 8 little panels in it. One of those panels is a panel that is very long in size. I am looking for a way to be able to scroll through that big panel without having to resize the window so that the whole thing will fit. As of right now, my main panel is created by
JPanel wholePanel = new JPanel(new GridLayout(8,1));
I then add each panel and the last panel I have tried to add several ways. One was to make a seperate
JScrollPane temp = new JScrollPane(finalPanel);
or when I add it to wholePanel, i do this
wholePanel.add(new JScrollPane(finalPanel));
Either way, the thing gets added in the end but will not scroll. I was wondering if I am missing something or if there is a better way to do this. Basically, I want to be able to scroll through a JPanel. I can get Jscrollpanes to work with JTextAreas and JLists, so I can not figure out what the problem is. Thanks in advance

Does the following help as an example ?
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class ScrollTest extends javax.swing.JFrame {
     JScrollPane scrollpane;
public ScrollTest()
     super("Scroll Test");
     setSize(300,200);
     init();
     setVisible(true);
public void init()
     JPanel p = new JPanel();
     p.add( new JLabel("Hello") );
     p.add( new JLabel("Hello") );
     p.add( new JLabel("Hello") );
     p.add( new JLabel("Hello") );
     p.add( new JLabel("Hello") );
     p.add( new JLabel("Hello") );
     p.add( new JLabel("Hello") );
     p.add( new JLabel("Hello") );
     p.add( new JLabel("Hello") );
     p.add( new JLabel("Hello") );
     p.add( new JLabel("Hello") );
     p.add( new JLabel("Hello") );
     p.add( new JLabel("Hello") );
     p.setSize(600,400);
     scrollpane = new JScrollPane(p);
     getContentPane().add(scrollpane, BorderLayout.CENTER);
public static void main(String[] args)
     new ScrollTest();

Similar Messages

  • Is there a way to adjust the settings on launchpad so that when I swipe into it all the open apps/pages are fully separated (like in exposé) so that I can fully view all of them simultaneously?

    Hi Apple community,
    This is my first go at this so be kind,
    My question concerns launchpad. Coming from Snow Leopard I had been using spaces. I like to keep certain bundles of programs on separate desktops, for example all word processing related tasks in one place. I have set up the equivalent on Yosemite.
    My problem is concerns the loss of exposé. Now I know when you swipe into launch pad you get a very similar effect but the issue I am having concerns the "zoom out" effect when you swipe into launchpad. With exposé all open apps/pages etc would be fully exposed - in my case several (sometimes as many as 9 word documents). What I am running into is when I do this in / into launch pad the "pile" of docs is exposed but they are still overlapping so I can't get a good look at which is which and visually identify where I want to navigate to.
    My question is this; Is there a way to adjust the settings on launchpad so that when I swipe into it all the open apps/pages are fully separated (like in exposé) so that I can fully view all of them simultaneously? If so, instructions on how to do so would be greatly appreciated. Any alternative suggestions to doing this outside of launchpad are also welcome. If there is an exposé app for example, I would be quite willing to go that route.
    My main concern is being able to quickly (ie a touchpad gesture) expand all the open pages so I can bounce between them.
    Much thanks from a loyal Apple friend.

    Hey Eric,
    Thanks for taking the time. Unfortunately no that does not solve it. Same as swipe it will get me there and it will show separate programs spaced out. The issue I am having is that all my open word files are bunched up in a pile on top of each other. I can see the edges of each one but I want them to be separated from each other enough that I can visually identify what file is what.
    Again, thanks for trying, it is appreciated.

  • Can not view all the thumbnails in version 9 adobe standard

    Hello,
    I recently installed adobe standard 9 running parallel with adobe standard 5.
    My end user is claiming of the view setting for patient data. She can not scroll all the way to the bottom
    as she could in adobe 5. She can see all the thumbnails minus the last row. I have changed the prefereces to show the same
    as adobe 5. However I can not get the correct settting to make it right for her.
    Any adivse or trouble shoot steps would be appreciated. Adobe said to update the product, I have done that last night.

    How do I do that?
    Date: Tue, 14 Dec 2010 10:10:01 -0700
    From: [email protected]
    To: [email address deleted by host]
    Subject: Acrobat Windows Can not view all the thumbnails in version 9 adobe standard
    Change the size of the thumbnails, change the size of the thumbnails window, or upgrade Acrobat X.
    >

  • "View All RSS Articles" Sometimes Stops All Pages from Loading

    Hi!
    I'd like some help with this:
    Sometimes, when I view a whole lot of RSS articles in one tab, the content stops loading after one hundred or so articles have come in. After this, no pages will load -- not even a local html file in my home directory.
    These message appears in the console:
    2007-01-17 13:10:37.996 Safari[6634] * -[NSCFString stringByAppendingString:]: nil argument
    (event handler):Null value
    Memory and CPU don't seem unusually high. I can still close tabs, export bookmarks and do other things with the menus. I just can't load a new page.
    Quitting and re-starting Safari is the only way I have found around this problem.
    Scott

    Wow... thanks for trying out those feeds that I suspected. It's a wierd problem, because it does not occur consistently.
    I reproduced the error by viewing all RSS articles in my news feeds bookmarks folder, and I used "Start Profiling with Sample" on the Debug menu to create a .sample file, and I stopped profiling when the error recurred a few seconds later.
    This produced a ten-thousand-line-long file that may contain useful information.
    Here's the console log section:
    2007-01-20 16:42:11.587 Safari[227] starting sample tool
    2007-01-20 16:42:39.834 Safari[227] * -[NSCFString stringByAppendingString:]: nil argument
    2007-01-20 16:42:44.918 Safari[227] sample tool output written to /tmp/SafariSample-2007-01-20-164211.sample
    The file is at
    http://homepage.mac.com/eyesquash/tmp/SafariSample-2007-01-20-164211.sample
    I also have excerpted my news feeds bookmarks folder, so if you like, you can try importing it into Safari and loading all of it at once (a bit over 1,000 articles). It's here:
    http://homepage.mac.com/eyesquash/tmp/news%20feeds.html
    I will try this from another account of my machine. I'll also try it from another account with Safari running in its messed-up state on my main account.
    You know, this would not bother me much at all if it weren't such a nice feature when it works. Most Apple things are like that for me: great when they work, and they usually work.
    Scott
    iBook G4   Mac OS X (10.4.8)  

  • TS1381 My left arrow does not work on my macbook pro(model A1226).  I have reset nvram, performed a safe boot, pulled the cache to desktop, replaced .globalpreference.plist, test all other keys with keyboard view (all others work)  - HELP!!

    My left arrow does not work on my macbook pro(model A1226).
    I have reset nvram, performed a safe boot, pulled the cache to desktop, replaced .globalpreference.plist, & tested all other keys with "keyboard viewer" (all other keys work except for the arrow). 
    In addition, I have gone thru all the recommended checks with universal access and have booted from snow leopard dvd and the left arrow still does not work. 
    I have tried using the left arrow key in all of applications I use such as: excel, ms word, address book, calendar, iphoto, terminal, & highlighting an icon and using the arrows to move to another selected icon.
    Here is the kicker!  In addition, I purchased a logitech solar bluetooth keyboard and the arrows work fine with my ipad but do not work when paired with the macbook pro. All other keys work fine on the macbook pro using the bluetooth keyboard.
    I believe this says that the problem is not in my macbook pro keyboard. So where can it be?
    Can anyone think of any other rabbit holes I can search?
    thanks and regards
    vats3

    I would also like to add that I've reverted the two cd drive and hard drive mods I did and the laptop is back to factory hardware and there is 0 corrosion or mold visible.

  • Magic Mouse need view all open applications....

    is it possible to have the same option to view the open applications in the new magic mouse, im a programer and always in need to haver several applications and run between them ... just bought the magic mouse its great loving it , but please insert a command to view all the open applications PLEASE
    Message was edited by: FranciscoCarlao

    A few hours later…
    I just found Mouse Wizard:
    http://www.samuco.net/web/node/23
    I will say that when I downloaded the demo the center button didn't work, but a very quick & courteous reply from their tech support suggested:
    In terminal, can you try entering this command: "rm ~/Library/Preferences/.MagicalWizard.plist". Then, relaunch MouseWizard.
    I did this & now I have center button nirvana! (Mouse Wizard also supports a version of the squeeze button (they call it fourth button) and squeeze/bloat gestures.)
    So far so good--it's made me much happier with my magic mouse.

  • How can I view all my apple map pushpin Points of Intrest and pictures at once?

    Been trying to find a way to view all my Apple Maps Points of Interest pushpins all at once on the map screen.  As I drive along routing, or when I zoom in and out of map areas.  Saved bookmarks shows a long list, but I can't figure out how to just view all the pushpins on the map, so I can access my favorite locations and notes as I drive or plan a trip. 
    Maybe create a map pushpin folder to save only pictures related to the saved map bookmarks.  And save on phone or skydrive?  I still just go by memory.  But the list, notes and scenes are getting really numerous.  RV campsites, fishing, biking, skiing, services, phone signal, shopping, wifi, laundry, jobs, pictures, and much more. 
    I have an old HP mini that I like and use with my iphone 4.  Have no interest or extra money to be upgrading my devices every time the software/bloatware updates overload otherwise perfectly good phones and laptops.  Hope to be able to share with others how to have their phones and computers work for them, instead of the other way around. 
    Might stay with iPhone and even buy an ipad if they become more univerally compatible, or switch to all windows devices.  Not too happy with PCs bloatware programming these days either.  My old windows 98 laptop runs some really powerful programs.  Wonder how many people would buy Jeeps and such vehicles, if they could not easily drive them on regular city streets or highways?
    first posting in online support community in 15 years.  Home powered by Solar these days.  Can even park next to a street light and charge batteries.
    Thanks for reading and any useful info.  will try not to lose my login info

    Been trying to find a way to view all my Apple Maps Points of Interest pushpins all at once on the map screen.  As I drive along routing, or when I zoom in and out of map areas.  Saved bookmarks shows a long list, but I can't figure out how to just view all the pushpins on the map, so I can access my favorite locations and notes as I drive or plan a trip. 
    Maybe create a map pushpin folder to save only pictures related to the saved map bookmarks.  And save on phone or skydrive?  I still just go by memory.  But the list, notes and scenes are getting really numerous.  RV campsites, fishing, biking, skiing, services, phone signal, shopping, wifi, laundry, jobs, pictures, and much more. 
    I have an old HP mini that I like and use with my iphone 4.  Have no interest or extra money to be upgrading my devices every time the software/bloatware updates overload otherwise perfectly good phones and laptops.  Hope to be able to share with others how to have their phones and computers work for them, instead of the other way around. 
    Might stay with iPhone and even buy an ipad if they become more univerally compatible, or switch to all windows devices.  Not too happy with PCs bloatware programming these days either.  My old windows 98 laptop runs some really powerful programs.  Wonder how many people would buy Jeeps and such vehicles, if they could not easily drive them on regular city streets or highways?
    first posting in online support community in 15 years.  Home powered by Solar these days.  Can even park next to a street light and charge batteries.
    Thanks for reading and any useful info.  will try not to lose my login info

  • I am a long time iTunes user but a new MacBook owner! :) I keep the majority of my music files on an external hard drive.   I'm trying to view all those files on my MacBook through iTunes.   With windows you would go to : File/Add To Library, and iTunes w

    I am a long time iTunes user but a new MacBook owner! I keep the majority of my music files on an external hard drive.   I'm trying to view all those files on my MacBook through iTunes.   With windows you would go to : File/Add To Library, and iTunes would add all your selected files to your music library BUT WOULD NOT COPY THEM TO YOUR HARD DRIVE.  In other words, if the external hard drive was connected, you could listen, drag/drop, and edit the files.   When I tried the same thing with my new MacBook... it actually started coping the files to my MacBook harddrive.  I don't want that, it's millions and millions of mp3's that I don't want to keep on my computer, only my external hard drive.   Can anyone help?    I'm sure it's something easy, I'm just so new to the Mac world.   Being an iPhone owner for many many years I'm picking up things fast, but this is getting the best of me!  Help !

    In iTunes 11 uncheck the preferences setting in in the iTunes Preferences panel "Advanced > Copy Files to iTunes Media folder when adding to Library"

  • Is there a way I can view all apps I have ever downloaded?

    Is there a way I can view all apps I have ever downloaded? Like some sort of historical list associated to my account?
    It would help a great deal- I restored my phone from a backup after my iphone crashed- but I had downloaded many apps since then, so now I have to re-download all the missing apps. Thing is I cant remember all of them?
    Anone else have the same problem?

    Have you never synced your phone? Syncing puts copies of each app into iTunes for you to manage and have available to sync over when you want.
    Other than that, in iTunes, from top menus (forget which one, think under help) you can access your account and then view purchase history.

  • Is there a way to view all cameras in the timeline at once without creating a multicam sequence?

    Is there a way to view all cameras in the timeline at once without creating a multicam sequence?  Is there some kind of window I can open where they will show up?  I am scrubbing a timeline and I would like to see all the cameras at once.

    The multicam monitor only shows multiple clips at once when they are part of a mutlicam sequence. is there some reason you don't want to use them inside a multicam sequence for previewing?
    Here is a possible workaround, if your workflow circumstances will permit it:
    Apply a pip preset effect  to each clip in the timeline. Use UL, UR, LL, LR presets and up to four video tracks will display at once. If you need to see more than that, you'll need to tweak their position parameters by hand. When you're done previewing them all at once you just need to delete their effects from the Effects Controls panel.
    I know it's not that neat or quick, but it will let you see everything at once in the program monitor.

  • How can I view all photos from a specific year?

    How can I view all photos taken in one calendar year like 2010? Is there a way to filter this way?

    Yes, create a smart album or a search with a "Date" rule or a Calendar rule.
    For example: New > Smart Album
    Add Rule:  Date
         Capture year is 2010.
    or: Add Rule: Calendar
    and click-step  the year back to 2010:
    In the Calendar it is a bit cumbersom to select a whole year, because it will only show 3 month at once. Select the first day and then scroll to to the end oft the year.

  • ICal for iPhone. View all events as a list without having to type into the earth box.

    iCal for iPhone. View all events as a list without having to type into the earth box.
    On the previous software version I used to be able to view all my calendar events as a list by clicking on the magnifying glass. Now you have to type into the search dialog box for a list to populate. This is very frustrating and annoying because I much prefer the list format to populate everything unless I specify what I am looking for into the search box. Is there a way to view all the events as a list without having to type anything into the search box?

    And you are aware of the possible options for listing the months and having an optional export value for each month.
    For listing the months, you can use a number, a 3 character string, or the full name.
    For the export value, the full name, the 3 character value, the 1-2 number, or the 0-11 JavaScript value.
    I would look at deciding how you want to populate the drop down box and build a one page form with just this field. You can then insert that page into a PDF and copy the field as needed and then delete the inserted page. Or you could create an FDF file to create the drop down box.

  • Is there a way to view all favorites on one page from different albums?

    is there a way to view all favorites on one page from different albums?
    I can't seem to figure out how to view all favorites at one time.
    nothing (thus far) is shared.
    paid membership to revel, also.

    oops - apparently you can do this from the app,
    but not from the web login view.

  • Is there a way to view all the table names in a certain schema?

    Is there a way to view all the table names in a certain schema?

    SELECT table_name FROM user_tablesThat won't do much good given this piece of information:
    i am trying to finish a lab for school but i don't know what tables are in my
    professor's schema. The appropriate solution is
    SELECT table_name
    FROM all_tables
    WHERE owner = 'PROFESSOR_YAFFLE'
    /This will show the names of the tables which Prof. Yaffle has granted to us.
    Cheers, APC

  • Is there a way to view all music without albums on itunes 12.0.1.26?

    Is there a way to view all music without albums on itunes 12.0.1.26?

    Try the Songs option from the drop down list control near the top right. Use the same control to turn off Show Artwork if needed/desired.
    tt2

Maybe you are looking for