Panel sizing issues! IT'S TOO BIG FOR IT'S BOOTS!!!!!

Hi there,
I have a Panel which I make the client of a ScrollPane. The ScrollPane is added onto a container. This is all fine. My challenge is that I have about eighteen components (labels - containing pictures, text areas, etc) on the one panel. The panel is set to BoxLayout (up and down style) which results in all the components being stacked one on top of the next. When the program runs the scrollPane is fine, and it has bars both horizontally and vertically. Ideally however I only want to have vertical scrollbars and no horizontal scrollbars because I want my content to be the width of the onscreen window. If I force the scrollPane's horizontal bar off then I can only see some of the content on the Panel because the Panel still takes up heaps of room. I have learned from this that it is not possible to control the size of the component that is the client of the scrollPane by playing with the scroll bars.
I figured the only logical way to get around my challenge is to control the size of the panel before it is made the client of the scrollPane. I set the size of the Panel explicitly with setSize(value1, value2) however the Panel still takes up a huge screen area.
Basically trying to explicitly set the Panel failed, the code compiled but there was no desirable outcomes. I really want to work out how to force the Panel to be a given size and then use only one scroll bar on the scrollPane. I figure that this is an issue related to BoxLayout, but I may be well of track with that hypothesis. My code is provided below if anybody can offer any clues they will be greatly appreciated.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class HelpGUI extends JFrame implements ActionListener
  HelpGUI()
    Toolkit tk = Toolkit.getDefaultToolkit();
    Dimension sSize = tk.getScreenSize();
    /* Fonts created here. */
    Font mainhead = new Font("Tahoma",Font.BOLD,22);
    Font subhead = new Font("Arial Black",Font.PLAIN,16);
    /* Images and there associated accomodations (labels) */
    ImageIcon pic1 = new ImageIcon("Images/launch1a.jpg");
    ImageIcon pic2 = new ImageIcon("Images/launch1b.jpg");
    ImageIcon pic3 = new ImageIcon("Images/launch1c.jpg");
    ImageIcon pic5 = new ImageIcon("Images/launch1e.jpg");
    ImageIcon pic6 = new ImageIcon("Images/launch1f.jpg");
    ImageIcon pic7 = new ImageIcon("Images/launch1g.jpg");
    ImageIcon pic8 = new ImageIcon("Images/launch1h.jpg");
    ImageIcon pic9 = new ImageIcon("Images/launch1i.jpg");
    ImageIcon pic10 = new ImageIcon("Images/launch1j.jpg");
    ImageIcon pic11 = new ImageIcon("Images/launch1k.jpg");
    ImageIcon pic12 = new ImageIcon("Images/launch1l.jpg");
    ImageIcon pic13 = new ImageIcon("Images/launch1m.jpg");
    JLabel icon1 = new JLabel("",pic1,JLabel.LEFT);
    JLabel icon2 = new JLabel("",pic2,JLabel.LEFT);
    JLabel icon3 = new JLabel("",pic3,JLabel.LEFT);
    JLabel icon5 = new JLabel("",pic5,JLabel.LEFT);
    JLabel icon6 = new JLabel("",pic6,JLabel.LEFT);
    JLabel icon7 = new JLabel("",pic7,JLabel.LEFT);
    JLabel icon8 = new JLabel("",pic8,JLabel.LEFT);
    JLabel icon9 = new JLabel("",pic9,JLabel.LEFT);
    JLabel icon10 = new JLabel("",pic10,JLabel.LEFT);
    JLabel icon11 = new JLabel("",pic11,JLabel.LEFT);
    JLabel icon12 = new JLabel("",pic12,JLabel.LEFT);
    //Labels containing strings.
    JLabel heading = new JLabel("INSTRUCTIONS",JLabel.LEFT);
    heading.setFont(mainhead);
    JLabel addhead = new JLabel("Adding a shortcut to the toolbar.");
    addhead.setFont(subhead);
    JLabel delhead = new JLabel("Deleting a shortcut from the toolbar.");
    addhead.setFont(subhead);
    /* Text blocks describing program operation, used in conjunction with the
    labels and images instantiated above. */
    JTextArea intro = new JTextArea(
      "This toolbar contains two established shortcut buttons. It also contains "+
      "three empty shortcut buttons. The toolbar can be customised to your exact "+
      "requirements. Please follow the instructions below if you are uncertain of "+
      "how to enter a shortcut. Alternatively you can delete shortcuts from this "+
      "toolbar by following instructions provided further down this page.");
    intro.setLineWrap(true);
    intro.setWrapStyleWord(true);
    intro.setEditable(false);
    //intro.setBackground(this.getBackground());
    JTextArea inst1 = new JTextArea(
      "1). On the File menu click New.");
    inst1.setLineWrap(true);
    inst1.setWrapStyleWord(true);
    inst1.setEditable(false);
    //intro.setBackground(this.getBackground());
    JTextArea inst2 = new JTextArea(
      "2). In the Please Enter Shortcut Details window enter a Shortcut Name "+
      "for the new shortcut.");
    inst2.setLineWrap(true);
    inst2.setWrapStyleWord(true);
    inst2.setEditable(false);
    //inst2.setBackground(this.getBackground());
    JTextArea inst3 = new JTextArea(
      "3). Click on the Open button. This presents the file browser."+
      "4). Select a relevant subdirectory and click the Open button.");
    inst3.setLineWrap(true);
    inst3.setWrapStyleWord(true);
    inst3.setEditable(false);
    //inst3.setBackground(this.getBackground());
    JTextArea inst5 = new JTextArea(
      "5). Repeat step 4 if necessary.");
    inst5.setLineWrap(true);
    inst5.setWrapStyleWord(true);
    inst5.setEditable(false);
    //inst5.setBackground(this.getBackground());
    JTextArea inst6 = new JTextArea(
      "6). Repeat step 4 if necessary.");
    inst6.setLineWrap(true);
    inst6.setWrapStyleWord(true);
    inst6.setEditable(false);
    //inst6.setBackground(this.getBackground());
    JTextArea inst7 = new JTextArea(
      "7). Select the required executable file and press the Open button.");
    inst7.setLineWrap(true);
    inst7.setWrapStyleWord(true);
    inst7.setEditable(false);
    //inst7.setBackground(this.getBackground());
    JTextArea inst8 = new JTextArea(
      "8). Press the Ok button.");
    inst8.setLineWrap(true);
    inst8.setWrapStyleWord(true);
    inst8.setEditable(false);
    //inst8.setBackground(this.getBackground());
    JButton exitbtn = new JButton("Exit");
    JPanel panel = new JPanel();
    panel.setLayout(new BoxLayout(panel,BoxLayout.Y_AXIS));
    //panel.setSize(sSize.width*14/17,sSize.height*9/10);
    panel.setBackground(Color.CYAN);
    panel.add(heading);          //"INSTRUCTIONS" heading.
    panel.add(icon1);            //First picture of toolbar.
    panel.add(intro);            //First text block.
    panel.add(addhead);          //"Adding a shortcut ..." heading.
    panel.add(inst1);            //First instruction 1).
    panel.add(icon2);            //Picture for 1).
    panel.add(inst2);            //Second instruction 2).
    panel.add(icon5);            //Picture of 2).
    panel.add(inst3);            //3). and 4).
    panel.add(icon6);            //Picture for 3 and 4.
    panel.add(inst5);            //5).
    panel.add(icon7);            //Picture for instruction 5).
    panel.add(inst6);            //6).
    panel.add(icon8);            //Picture for instruction 6).
    panel.add(inst7);            //7).
    panel.add(icon9);            //Pic 7).
    panel.add(inst8);            //8).
    panel.add(icon10);           //Pic 8).
    Container c = getContentPane();
    JScrollPane scrollPane = new JScrollPane(panel);
    scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
    //scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    c.add(scrollPane);
    setLocation(sSize.width*18/100,sSize.height*1/20);
    setSize(sSize.width*14/17,sSize.height*9/10);
    setTitle("Java QuickLaunch Toolbar");
    setVisible(true);
  public void actionPerformed(ActionEvent e)
}Thanks heaps

Interestingly enough, the preferredLayoutSize method of the layout manager attached to the JScrollPane never gets called when the scroll pane is resized horizontally, only vertically. I found this out by subclassing BoxLayout so that it printed a string when certain methods were called. I did that after noticing that I can resize your help window vertically with no problem, but horizontally is a different story -- when I increase the horizontal size, the JPanel grows to fit, but when I decrease the horizontal size, the JPanel stays the same size. Returning smaller Dimensions in preferredLayoutSize of my overrided BoxLayout class didn't help.
I investigated further and subclassed JPanel to print a message when setSize or setBounds was called. When I vertically resized the help window, JPanel.setBounds was called to resize the JPanel. I was expecting that. However, when I horizontally resized the help window, the JPanel size wasn't updated... at least not in the way I expected it to be. When I increased the horizontal size past the maximum horizontal size so far, the JPanel's horizontal size was increased to match. However, when I decreased the horizontal size, the JPanels horizontal size was not decreased to match.
So, here's what I found:
1) JScrollPane vertical size increased: Scrolled component vertical size increases to match.
2) JScrollPane vertical size decreased: Scrolled component vertical size decreases to match.
3) JScrollPane horizontal size increased: Scrolled component horizontal size increases to match.
4) JScrollPane horizontal size decreased: Scrolled component horizontal does not change.
So the scrolled component horizontal size gets increased, but never decreased. This is odd... perhaps it is a JScrollPane bug? I'll see if I can't figure out a way around it. Overriding the scroll pane's setBounds and setSize methods didn't work, perhaps I'll target the JViewport next.
Sorry I couldn't help right away, though. Lemme know if you figure it out.

Similar Messages

  • Scanned doc now too big for print

    Hi,
    I have scanned this sheet and modified it, now i need to print it back but photoshop says its too big for print.
    Indeed it just printed a portion of it.
    Can someone with experience of this kind of issue explain me the technicalities and what should i do?
    I know photoshop only when it comes to chop pictures, put loads of filters and make them jolly, i am not into stuffs like scan/sizing/printing, etc.,  so please don't explain to go down to the basic basics in your explanation.
    Thanks

    Well, when you say "Manufacturer's software" I assume you mean the scanner's software and NOT Photoshop.  It is best to scan directly into Photoshop by using the menu File>Acquire Image>[select your scanner source--either the scanner name or TWAIN driver].  When this is chosen your scanner's driver will launch a "plug-in" software interface that will allow you to scan the document and set a marquee around what you want to scan and also choose the resolution.  After that you will be able to save the document -- give it a unique name like "file.psd" -- and then make changes -- again give it a unique name like "file_edited.psd".   The document measurements you gave us seem to fit within the bounds of a United States (US) Letter size document which is 8.5 inches x 11 inches.  If your printer has the ability to print borderless documents you should be able to print this document without a problem with a resolution of 300dpi.  It is possible that it would not be able to if there is not enough memory on your printer and that is why you get the error message.  (But as a JPG image the file size will be compressed, so I'm not really sure why your document would be too large.)

  • Desktop is too big for the display

    Some how this morning while on my Mac a display setting or something was changed. If your on the desktop, with all windows closed, the background, icons, dock.....everything is too big for the display. If you move the cursor all the way to left it will 'slide' the desktop in that direction. Move it all the way to the right edge of the display and it 'slides' the desktop to the right until you reach the edge. Also the same for the up or down directions.
    At first I thought it had something to do with the multi-touch track pad, but I don't think so. I have checked all the display settings I can think of and have tried re-sizing the desktop to all other settings in an attempt to fix the problem. Additionally I have restarted/shutdown the computer totally to see if it would fix the issue. No success. Please help.
    Thx,
    Audioboy

    I had the same problem, but the zoom was already off. So I went under "options" and unchecked "use scroll wheel with modifier keys to zoom," and that took care of it.
    Thought that might help some others who find this thread.

  • My iPad standard window is bit too big for the screen.

    My iPad screen unexpectedly got slightly too big for the display window. The size is bit too big. For example, the keyboard when it pops up does not fully display all tkey sans. Another example is the time/power remaining bar slips out of sight.  Did I accidentally change something?  Is this an issue with version of iOS that I am using (4.3.3)? (Note I'm not talking about resizing by using your fingers.)

    John,
    I am having the same problem.  The enlargement is not the same as the 3 finger tap or the 2 finger zoom.  The screen opens and then bumps to a slightly larger screen just enough to make it too big to see the outer edges.  You can put 3 fingers on the screen and move the screen to see the edges but you cannot get it to shrink to the correct size.  This is the second time this has happened to me.  I am also having some other issues.  Sometimes while in an app the app will close and I will be diverted to the home screen.  And sometimes when playing "with Friends games" the letters on the letterboard (not the key pad) disappear, will not move or are giant.  I plan on taking it back to the Apple store this week but I hate the idea of having to start over.

  • NB305 first time setup display too big for screen

    I just bought an NB305-310 netbook  (two, actually, and the first one had no trouble). It came loaded with Windows XP.  When I turned it on I wasn't able to set it up right away, when I came back to it, I found the display of the welcome screens and the setup process assistant is too big for the screen, as if it thinks it has to fill a 15" or 17" screen instead of 10".  So I can't see to click on the "I agree" box or the "Next" button etc., so can't proceed through the setup.
    I already tried restarting it a couple times (by holding down the power key, since Control-Alt-Delete didn't do anything).  I also tried using the function key with various keys that looked like they might affect display size but no change.  Even the volume function keys didn't change the volume of the setup background music that plays.
    How can I fix this?
    Thank you!
    RD

    mini notebook NB305-N310 
    Try this. Press Alt + Spacebar to open the control menu (which may be off the screen) at the top-left of a window.
    Then press M (for Move).
    That will enable you to move the window using the arrow keys.
    When you get the chance, you'll want to go here and reset the screen resolution to 1024 x 600.
       Control Panel > Display > Settings tab > Screen resolution slider
    -Jerry

  • Yahoo page is too big for monitor screen. How doI reduce size of yahoo page?

    When I open firefox the yahoo home page is too big for the size of the monitor.

    Hi,
    Try resetting the zoom by pressing '''Ctrl''' + '''0''' (zero) on the keyboard. Please [https://support.mozilla.com/en-US/kb/how-do-i-use-zoom?s=zoom+feature&r=0&as=s see this.]
    Useful links:
    [https://support.mozilla.com/en-US/kb/Options%20window All about Tools > Options]
    [http://kb.mozillazine.org/About:config Going beyond Tools > Options - about:config]
    [http://kb.mozillazine.org/About:config_entries about:config Entries]
    [https://addons.mozilla.org/en-US/firefox/addon/whats-that-preference/ What's That Preference? add-on] - Quickly decode about:config entries - After installation, go inside about:config, right-click any preference, enable (tick) MozillaZine Results to Panel and again right-click a pref and choose MozillaZine Reference to begin with.
    [https://support.mozilla.com/en-US/kb/Keyboard%20shortcuts Keyboard Shortcuts]
    [https://support.mozilla.com/en-US/kb/Safe%20Mode Safe Mode]
    [http://kb.mozillazine.org/Problematic_extensions Problematic Extensions/Add-ons]
    [https://support.mozilla.com/en-US/kb/Troubleshooting%20extensions%20and%20themes Troubleshooting Extensions and Themes]

  • 15 minute, 400 meg project too big for one DVD?

    I have a 15 minute video in widescreen format that is about 400 megabytes in size according to the project info.
    When attempting to burn, I am told that the project size is too big for a DVD and suggests I use a dual layer DVD.
    I have over 390 gig available on my 1 TB hard drive.
    I have no chapter markers
    I have reduced the intro clip(s) to less than 30 seconds.
    All to no avail. I am now burning the dvd using Toast, which is perfectly happy using 400 megabytes of my DVD to burn the disk.
    What assets could iDVD possibly be adding to use up the remaining 4 gig of disk space, and how might I view them and delete them?
    I know this is an old topic...I've read lots of posts including one similar to mine. In most cases people are attempting to burn over 1 hour of video. In the one case similar to mine, the person had full length video in each chapter marker (or some such issue). I have none.
    In my case it is a 15 minute video (granted its in HD/widescreen format). Why, with a project size well under the disc size, does it refuse to burn due to size limits? Clearly the project info does not reflect iDVD's actual size requirements for the project.
    Why not?
    Finally, changing to 4x3 is not an option and yes, I have tried changing the compression algorithm from best performance to higher quality, though this is supposedly for video longer than 60 minutes.

    Hi
    Free space only referes to Start-up (boot) hard disk. iDVD can't use any other for scratch files.
    25Gb is my minimum setting.
    15 minutes video - to much indicates that it might have been droped it into iDVD window
    but here landed it into a "button area" - not movie area.
    Recommendation in case of this is to move it out (or start a new iDVD project)
    and in iDVD use the Import function instead. Now it lands where it should.
    And dep on Your encoding choise the movie can be up to 60 or 120 minutes long
    (menu included => simple menu = more movie)
    Other alternative is feeding iDVD strange video formats that can give many
    interesting problems eg .wmv, .avi, .mpeg4 etc.
    Yours Bengt W

  • PC - TV [Video too big for TV Screen.]

    Hi,
    I'm running Windows XP with an FX 5200 128 Video Card. I have an S-Video plug that turns in to a Yellow RCA wire and plugs in to my TV. I have my display properties set to "Clone".
    When I play a video using Windows Media Player, I can see it on my Computer Screen as well as my TV.
    However, the picture on my TV seems to be slightly cropped. It looks like I am missing the TOP and SIDE portions of the Video. The video fills the entire TV screen, but it looks like the picture is too big for the TV and I'm not seeing the edges.....
    Any suggestions,
    Thanks,
    Andrew.....

    make sure you're using the correct display drivers from nVidia Drivers
    then in the driver control panel for your TV settings, use the zoom controls to adjust how the picture looks on your TV

  • "[Filename]" is too big for the trash. Would you like to delete it permanently?

    Recently, when I delete files, I am getting a message stating, ""[Filename]" is too big for the trash. Would you like to delete it permanently?". This recently started showing up for no reason and in the past I have deleted files significantly bigger and not recieved this message. Any ideas why this is showing up and how I can stop it from happening?
    For reference, I have a 768GB SSD with approximately 470GB of space available so space is not the issue.

    nbar, it seems that this trash issue is a reoccuring issue and that it is resetting itself. I followed the article that provided a link to, but after following the steps and finding success, it started doing it again.
    If anyone has any idea on what might be causing this issue, it would be greatly appreciated...not a life or death situation...just really annoying.

  • How big is too big for swf?

    I have a swf file that has audio associated with about 15 slides. We were having some problems with it downloading and the people that host our LMS (Moodle) said that some of the problems may be related to our CP4 settings. I have the preloader set to 25% and the file is about 8.6 MB. They said to us:
    Usually when hand-coding a SWF I require 100% of the SWF to be loaded before the SWF begins to play.
    8.6mb is large for a SWF provided via progressive download. The optimum is no more than 5mb for users with a broadband connection. That may be part of the issue.
    Is 8.6 MB really too big for a swf? What is the maximum size this should be? If it is too large what else can I do to shrink the audio as I'm sure that's a great deal of what is making the file too large?
    Thanks very much,
    Whitney

    Hey Whitlowe,
    I had a very similar situation.  I received a 15 MB file from a "co-worker." The course was basically a converted PowerPoint into a Captivate course.  The course had 53 pages and had heavy audio.
    When I initially tried to publish it to my LMS the course took about ten minutes to load.  I’m not sure if you use another authoring tool but I used another authoring tool called "Tool Book" a SumTotal product.  I had to divide the captivate course into 8 SWF files.  I then used Toolbook as a wrapper.  The Tool Book file was 8 pages.  Because Tool Book can read each page as a different SCO, the SWF files loaded one at a time. 
    For future courses, I am looking at getting a streaming server.  I can house my audio on the server.  The course would launch as a shell but would link to a streaming server for the audio/video.  Not only will this improve load time but decrease my space on the LMS.  I am looking into this option and not positive what the results will be, but I thought I would throw it out there.
    That is the only solution I currently know of. I’m carious of any other solutions as well.
    Good luck.

  • When I open my iPad the page is too big for the screen and won't shrink down. The keypad has also become very 'sticky'

    Recently when I open any apps the pages are too big for the screen. They shrink when pinched but immediately become bigger again. It's very difficult to scroll too. The keypad has become very sticky. Missing letters and spaces when I type and needing to tap the keys much harder than usual

    I have the exact same problem, I think.  I was on my iPad 3's home page swiping R-L to locate a certain icon when all of a sudden the screen appeared to get HUGE.  So big I could only see one or two icons.  I couldn't even turn it off to try a reboot because after I pushed the sleep/wake button, I couldn't find the red slide bar.  I finally just had to wait for the battery to die, then recharge it, and it looked normal again.  I also spoke with several friends who haven either iPads or iPhones, and they've all had this happen to them.  I checked my accessibility settings, and Zoom was already off.  So what is causing this problem for so many people, and what can we do to prevent it?  Please help.

  • I have my iTunes library on an external HD because it is too big for my iMAC 500GB HD. I want to backup my external HD. Can I do this with any Apple cloud product or should I look elsewhere? Also is it worth just buying another external HD to back up

    I have my iTunes library on an external HD because it is too big for my iMAC 500GB HD. However, it is not backed up, so I need a solution to backup my external HD. Can I do this with any Apple cloud product or should I look elsewhere for cloud products? Will it be cheaper/easier just to buy another external HD to back up my existing external HD? Thanks

    I don't know if this is me adding files to iTunes when the external wasn't connected
    it is.
    is it OK to just keep deleting that library on the Air?
    i wouldn't - at least not until i
    mount the external
    point iTunes media folder location back to the external via preferences > advanced
    consolidate my library via file > library > organize library
    The ntfs hasn't seem to be causing any problems, but I've always wanted to know.
    in order for your Mac to write to NTFS drives, it needs some help by installing e.g. the NTFS 3G driver. apparently that or something similar is installed on your Mac already. preferably, it would be formatted for Mac but then windows machines would need to have e.g. MacDrive installed to recognize the drive.

  • Why does is say purchaseable items too big for download every time I try to download an app?

    Every time I try to download a game or app my iPhone says error message purchasable items too big for download. I even changed my billon information. Anyone know what the problem might be?

    Connect your iPad to iTunes on your Mac/PC and then go to your iPad's summary window. Then click back up if you want to back up your iPad first. After that click restore. Later it will ask you if you want to setup the iPad as a new iPad. Select the option to setup your iPad with your latest back up.

  • A document page opens that is too big for the display and runs off the end of the monitor

    How do you fix a problem where document pages open that are too big for the display and runs off the end of the monitor? The borders are off the monitor so there is no window edge to grab and adjust.

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, or by a peripheral device. 
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. Note: If FileVault is enabled, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including sound output and  Wi-Fi on certain iMacs. The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin. Test while in safe mode. Same problem? After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

  • Sim card too big for ipad air?

    i have taken delivery today of a new ipad air but even the mini simcard seems too big for the holder, is it safe to still put it in?

    No. The iPad Air uses a Nano Sim. A Mini sim will not fit in the tray.
    You need to talk to your Cellular carrier and have them give you a nano sim for the new iPad.

Maybe you are looking for