JSplitPane resize problem (not a minimum size problem though)

I created a JSplitPane and put a JPanel in both the top and bottom sides. This JSplitPane is in the center section of a BorderLayout of a JFrame. The minimum sizes are set and I can move the divider bar all I want. Instead, I am having trouble resizing the window and having the divider bar becoming shorter. When I resize the window, the width of the images dont become smaller even though they have a minimum size set to a minimal size and there is space in the panels that can be reduced.
Here is the code that I am playing with to get this to work. Any ideas how to get this to work? It works in the SwingSet2 Demo, but there is so much extra junk in there that I cant determine the differences with what I'm doing.
Thanks,
J.R.
import java.awt.*;
import javax.swing.*;
public class SplitPaneJFrame extends JFrame {
JPanel statsPanel = new JPanel();
JPanel northPanel = new JPanel();
JPanel southPanel = new JPanel();
JSplitPane splitPane;
public SplitPaneJFrame () {
setupGUI();
private void setupGUI() {
setDefaultCloseOperation(EXIT_ON_CLOSE);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
setSize(screenSize.width, screenSize.height - 64);
Container c = getContentPane();
c.setLayout(new BorderLayout());
JPanel p1 = new JPanel();
p1.setMinimumSize(new Dimension(100,100));
p1.setPreferredSize(new Dimension(500,250));
p1.setBackground(Color.yellow);
p1.add(new Button("This is a button for the top area"));
JPanel p2 = new JPanel();
p2.setMinimumSize(new Dimension(100,100));
p2.setPreferredSize(new Dimension(500,250));
p2.setBackground(Color.red);
p2.add(new Button("This is a button for the bottom area"));
splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true, northPanel, southPanel);
splitPane.setOneTouchExpandable(true);
northPanel.setLayout(new BorderLayout());
northPanel.setMinimumSize(new Dimension(100,100));
JPanel panel = new JPanel();
panel.setLayout(new FlowLayout(FlowLayout.LEFT,0,0));
panel.setPreferredSize(new Dimension((int)Math.min(1012, getSize().width * .75), (int)(getSize().height * 0.75)));
panel.setMinimumSize(new Dimension(100,100));
panel.add(p1);
northPanel.add(panel);
southPanel.setLayout(new BorderLayout());
southPanel.setMinimumSize(new Dimension(100,100));
southPanel.add(p2);
splitPane.setDividerLocation(0.75);
c.setLayout(new FlowLayout(FlowLayout.LEFT,0,0));
c.setBackground(Color.white);
JPanel jp = new JPanel();
jp.add(splitPane);
c.add(BorderLayout.CENTER, jp);
setVisible(true);
public static void main(String args []) {
new SplitPaneJFrame();

Hmm. Ok, that was dumb on my part :-) Sometimes you just need a second set of eyes.
Any Idea why, after I make the fix, the top panel does not resize at all? The bottom one does, but the inner panels of the top do not. I added a second panel to the top and it flowed under the first one panel (p1) as the outter panel (northPanel) resized, but the inner panel stays the same size regardless of how much I narrow the window.
J.R.

Similar Messages

  • Tab font problem (not a web-site problem)

    In the main design page, all the tabs with text on
    them (such as Common, Layout, Text, Tables, etc) are so small, they
    are only represented by a few pixels. You literally cannot read
    them at all. I am a true Noob with Dreamweaver, so I really need to
    be able to read these tabs. Even the text at the bottom left
    portion of the screen is too small (the workspace tabs and the
    <xxxx> items)... I can't make them out at all.
    Help please?
    p.s. this is not about a web design... this is referring to
    the actual program itself.

    Is this a new install and it's been like that since starting?
    Or an old
    install and it used to be okay?
    Are the main menus okay? Only the words in the Insert Bar are
    off?
    If you change to a different User on that machine, same
    problem?
    Uninstall and reinstall. May want to get and run the CS3 or
    CS4 Cleaner app
    from the adobe site to fully uninstall.
    http://www.adobe.com/support/contact/cs3clean.html
    http://www.adobe.com/support/contact/cs4clean.html
    [back up site definitions first]
    And it wouldn't hurt to run through the steps in the technote
    about corrupt
    fonts.
    Alan
    Adobe Community Expert, dreamweaver
    http://www.adobe.com/communities/experts/

  • I have moved from uk to Ireland and changed my mobile provider, but I can't send texts to uk numbers.  My service provider say it is an I phone problem, not a service provider problem.

    I have moved from uk to Ireland and had to change my service provider, but despite 3 calls to my service provider I can't send texts to the uk. They have checked it out by my using a different SIM card, but I still cannot send texts. They say it is problem with my iPhone 4's settings and told me to contact apple. Can anyone help me?

    If you can find out what country your iPhone was officially sold in, you could take it there (or if originally sold in the EU, take it to any EU country where Apple officially sells the iPhone) or you could send the iPhone to someone you know in that country who could get it serviced and then ship it back to you. Apple Support does not accept shipments from other countries, and will not ship a serviced iPhone to another country.
    This, though, presumes that the iPhone has not been modified as your service provider claimed. If it has, Apple will not provide service for it in any country.
    You may be able to find out what country your iPhone was officially sold in by calling Apple Support:
    http://support.apple.com/kb/HE57
    and giving them the serial number.
    Regards.

  • How to Resize a Datafile to Minimum Size in sysaux tablespace

    Hi Experts,
    I found the init data file size is 32712M in sysaux table. our other DBA added 2 big datafile for spilled issue in sysaux. After cleared data and fixed spill issue. I want to reduce datafile size.
    as ALTER DATABASE DATAFILE 'D:\ORACLE\ORADATA\SALE\SYSAUX05.DBF' RESIZE 10000M...
    I got error message that used data size is over resize size.
    ERROR at line 1:
    ORA-03297: file contains used data beyond requested RESIZE value
    However, I checked data size is only 176M in this datafile in OEM.
    How to fix this issue?
    I use oracle 10G R4 in 32 bit window 2003 server
    JIM
    Edited by: user589812 on May 18, 2009 11:22 AM

    10.2.0.4
    If I run as
    SQL> alter database datafile 'D:\ORACLE\ORADATA\SALE\SYSAUX05.DBF' offline drop;
    Database altered.
    the file is still in database.
    can I make online for this file again?
    could we delete it by SQL as
    alter tablespace sysaux drop datafile 'D:\ORACLE\ORADATA\SALE\SYSAUX05.DBF';
    Thanks
    Jimmy
    Edited by: user589812 on May 18, 2009 12:16 PM
    Edited by: user589812 on May 18, 2009 12:33 PM

  • Document not printing full size

    I am a new pages user, and I am creating a magazine for an english class. Two out of four of my articles do not print full size, even though the paper size is set up and everything else seems to be full size. When I look at print preview, the article is shrunk down and I have no idea how to go about fixing this.
    MacBook Pro   Mac OS X (10.4.8)  

    Kurt,
    I'm not implying it's a bug. I recognize that it's a "feature." But I'd like to be able to print my doc without having to first turn the Comments feature off. It would make a good Preference selection. But I also like your idea about the warning.
    -Dennis

  • Window.resizeTo in addon (overlay commonDialog) does not resize after some minimum size in FF v17 & 18

    I created an addon which overlay commonDialog.xul.
    In the load event, window.resizeTo is called and set to a very small size (like 10x10) so it is almost invisible to users.
    This works fine in FF 15. After upgrading to FF 17 or FF 18, this stops working.
    When I set the size big, it works fine. When setting it to a small size, it seems like when hitting a limit, the window size stays the same. The window size is the same when setting to 10x10 or 100x100.
    This is on a MAC, but same behavior is observed on Windows too.
    It seems like there is a minimum size predefined and the window does not get smaller than that.
    Aren't we supposed to be able to resize the window as we wish in the addon?

    If you create your own window with a unique ID then it should be possible to create more specific CSS rules for that window.
    How (when) do you resize that window when you need it to show with the default dimensions?
    If you have specific questions about developing extensions then it is best to ask advice at the MozillaZine Extension Development forum.
    *http://forums.mozillazine.org/viewforum.php?f=19
    The helpers at that forum are more knowledgeable.<br>
    You need to register at the MozillaZine forum site in order to post at that forum.

  • Software problem? Installed graphics card does not meet minimum requirements

    Ok - I seem to have just met the same problem that others have experienced. MB Pro, less than 3 years old, graphics card NVIDIA GeForce 9400M 256MB.  I have been using Aperture up until about 1/2 hour ago with no problem.  Just now trying to sync my iPad, and Aperture (which launches automatically) responds with "installed graphics card does not meet minimum requirements".  All software is fully up to date, running latest versions of all Apple software.  What is going on please?  I have restarted several times, tried Command/Option/P/R on restarting, but nothing seems to make it work.

    You might try to reboot again, this time with the Shift-key hold down to boot into safe mode. This will clear some caches and reset the graphics card. Aperture will not run in safe mode. You will have to reboot a second time.
    Do you use an external Monitor? Then disconnect it, before rebooting.
    Regards
    Léonie
    P.S: Do you use a blue tooth keyboard? If you turn it on while booting, you may accidentally boot into Safe mode without noticing it, and then Aperture will give exactly the above error message.

  • 'Margins Do Not Match Page Size' Excel 2011 problem - nothing working now. Mac 10.9.2

    Hey folks. PLEASE help. I'm running Mac 10.9.2 with Excel 2011 on a macbook pro. All of a sudden i'm getting an error 'Margins Do Not Match Page Size' on Excel as soon as i start doing anything e.g. adjust page size, try to print. Help?
    Ive seen previous questions on this but nothing recent and none of the solutions seem to fit.
    Any ideas?
    Tahnks

    Kernel Panics today:
    Kernel Extensions in backtrace:
             com.apple.filesystems.smbfs(2.0.2)[E043DE0F-9336-3C61-9C82-F029B430A3EB]@0xffff ff7fabb77000->0xffffff7fabbc2fff
                dependency: com.apple.kec.corecrypto(1.0)[DB137B94-65D2-32AF-B5BC-80A360E104C3]@0xffffff7fa bb2b000
                dependency: com.apple.kext.triggers(1.0)[A7018A2E-1C0C-37B8-9382-67786A396EAF]@0xffffff7fab b72000
    Kernel Extensions in backtrace:
             com.apple.filesystems.smbfs(2.0.2)[E043DE0F-9336-3C61-9C82-F029B430A3EB]@0xffff ff7f85e2c000->0xffffff7f85e77fff
                dependency: com.apple.kec.corecrypto(1.0)[DB137B94-65D2-32AF-B5BC-80A360E104C3]@0xffffff7f8 3f2b000
                dependency: com.apple.kext.triggers(1.0)[A7018A2E-1C0C-37B8-9382-67786A396EAF]@0xffffff7f83 f72000
    BSD process name corresponding to current thread: Finder
    Mac OS version:
    13E28

  • Weirdest disk size problem...

    MacBook Pro (13-inch, Early 2011)
    I had 256 GB ADATA SSD, SP900, which was working just fine, until a couple of days ago when I suddenly started to get “Startup disk full” message. I copied 20-30 GB onto external drive, twice that day, deleted those files, space freed up, but in a couple of hours I’d start to get the same message(s) again.
    I made all files visible, selected ALL files in the root of the disk, then cmd+alt+I…. Got around 165 GB. Yet, when I selected Get Info on the Macintosh HD icon, it said 3 MB free, 256 used…
    Pulled the SSD out, put regular old school WD 500GB disk inside, did a clean install and then migrated all of the accounts, applications and other data via Migration Assistant… Volia…. SAME!!! Except, this time, half of the 500 GB disk was full - 256, while the actual data still took up about 165 GB.
    Pls take a look at the screenshots:
    The first odd thing - I can’t see the (brand/manufacturer) name of the disk - I see Macintosh HD as the “root” name and then, below, Macintosh HD as the volume/partition name.
    I have NO option for formatting or resizing/adding/deleting volumes. Had this same issue while ADATA SSD was inside… but choose to ignore it, as I wasn’t experiencing any other problems.
    Notice at the bottom, it says 19 MB is free, 499 GB is used, while the picture above clearly states different. This is even worse than information I get with get Info on the Macintosh HD.
    Ok, lets see the content and the total size of the files and folders in the root of the disk:
    What am I missing here? Deleted sleepimage hibernation file… Checked all the cache and temporary folders… I knew from the start the that was not the problem, as folder/file size can be seen from the root of the disk with show all files option….. Did a PRAM reset to no success.

    MacBook Pro (13-inch, Early 2011)
    I had 256 GB ADATA SSD, SP900, which was working just fine, until a couple of days ago when I suddenly started to get “Startup disk full” message. I copied 20-30 GB onto external drive, twice that day, deleted those files, space freed up, but in a couple of hours I’d start to get the same message(s) again.
    I made all files visible, selected ALL files in the root of the disk, then cmd+alt+I…. Got around 165 GB. Yet, when I selected Get Info on the Macintosh HD icon, it said 3 MB free, 256 used…
    Pulled the SSD out, put regular old school WD 500GB disk inside, did a clean install and then migrated all of the accounts, applications and other data via Migration Assistant… Volia…. SAME!!! Except, this time, half of the 500 GB disk was full - 256, while the actual data still took up about 165 GB.
    Pls take a look at the screenshots:
    The first odd thing - I can’t see the (brand/manufacturer) name of the disk - I see Macintosh HD as the “root” name and then, below, Macintosh HD as the volume/partition name.
    I have NO option for formatting or resizing/adding/deleting volumes. Had this same issue while ADATA SSD was inside… but choose to ignore it, as I wasn’t experiencing any other problems.
    Notice at the bottom, it says 19 MB is free, 499 GB is used, while the picture above clearly states different. This is even worse than information I get with get Info on the Macintosh HD.
    Ok, lets see the content and the total size of the files and folders in the root of the disk:
    What am I missing here? Deleted sleepimage hibernation file… Checked all the cache and temporary folders… I knew from the start the that was not the problem, as folder/file size can be seen from the root of the disk with show all files option….. Did a PRAM reset to no success.

  • JTree: Problems updating the nodes size

    Hi,
    I'm trying to update the content of a JTree and I wonder how it
    really works, since the paint() method doesn't seem to call the
    renderer.
    My situation: Imagine a JPanel splited in two by a JSplitPane. In
    the left is the tree. Each node in the tree shows two panels, one
    aligned to the left, and another to the right. I need that the panel
    containing the two use all the available space in the left part of the
    Split panel.
    My solution: I pass the left JPanel to the tree renderer, so that
    it can get the width from it (inside the
    getTreeCellRendererComponent()) to build the return JPanel with the
    correct size. My logic is that since each time you move the JSplitPane
    the JTree paint() method is invoked the renderer can return the
    correct JPanel with the correct size that will be painted then in the
    screen.
    My problem: Doens't work. When I render the tree, the renderer is
    invoked, but it doesn't change its size (I can change the color based on the width, but not the node size). Only when I collapse & expand a node, it correctly takes into account the .setPreferredSize() and returns the JPanel with the correct size.
    The only way I found to update the tree involves to catch the
    JSplitPane event and call updateUI() in the tree, something that, I
    think, it's certainly not the correct way to do it.
    Any explanation of why this doesn't work would be really great. Any
    pointer to a web resource explaining in deep how Swing components work (specially the JTree) would be a godsend.
    Thanks,
    - Juancho

    My situation: Imagine a JPanel splited in two by a JSplitPane. Got it.
    In the left is the tree. In the left side of the JSplitPane is a JTree.
    Each node in the tree shows two panels,Maybe... on the right side of the JSplitPane are two Panels in which the data depends on which node is selected in the JTree???
    Maybe... you have a custom TreeCellRenderer which displays a pair of panels in place of the standard JLabel???
    one aligned to the left, and another to the right. To the left of what??? To the right of what???
    I need that the panel containing the two use all the available
    space in the left part of the Split panel.Panel containing the two what??? I thought the left part of the SplitPanel contained a JTree???

  • AD CS Web Enrollment Error - "public key does not meet the minimum size required"

    I've installed a standalone root CA and a enterprise subordinate CA in our environment - both are Windows 2008 R2. Everything is working except for Web Enrollment using a custom User template. I duplicated the default User template and choose
    2003 Compatible for the new one. I changed the minimum key length to 2048 and set the validity period to 2 years.
    We'd like to avoid using the Advanced Certificate Request page, so I modified certrqtp.inc to point to the new template:
    Else
    ' Request types for enterprise
    rgAvailReqTypes(0,FIELD_TEMPLATE)="User-custom"
    rgAvailReqTypes(0,FIELD_FRIENDLYNAME)=L_UserTemplateCert_Text
    rgAvailReqTypes(0,FIELD_CSPLIST)="Microsoft Enhanced Cryptographic Provider v1.0?Microsoft Base Cryptographic Provider v1.0"
    rgAvailReqTypes(0,FIELD_CSPLIST2)="Microsoft Base Cryptographic Provider v1.0?Microsoft Enhanced Cryptographic Provider v1.0"
    rgAvailReqTypes(0,FIELD_EXPORTABLE)="True"
    nAvailReqTypes=1
    End If
    I also ran into this issue where Web Enrollment jumps straight to the Advanced page if the original User template isn't present on the CA:
    http://social.technet.microsoft.com/Forums/en/winserversecurity/thread/9ab514bc-1f9f-424e-b70d-705874d9c623
    So I have both User templates loaded on the CA, and I get this error back when attempting a certificate request using IE 8 or 9:
    Your certificate request was denied.
    Your Request Id is 25. The disposition message is "Denied by Policy Module".
    Contact your administrator for further information.
    Looking at the CA's Failed Requests section, I see this error:
    The public key does not meet the minimum size required by the specified certificate template. 0x80094811 (-2146875375)
    I double-checked our custom template and it does specify 2048 as the minimum key size.
    Also, when trying with Chrome 11.0, I get an extra option during enrollment asking for a key size (1024 or 2048). When I choose 2048, the certificate request succeeds. I don't get the key size option when using IE, though.
    We'd like to get this working with IE if possible. Any ideas?

    We had the same error message. The problem turned out to be on the requesting computer, not the server. When we went to renew a cert in IIS on a server it was generating a 1028-bit key request. Since the minimum on the server was set to 2048-bit
    the request failed. So, there's two ways to handle this. You can change the certificate template on the server to have a minimum set to 1024-bit or you can have IIS submit a new request for a certificate and choose 2048-bit as the size of the key during the
    wizard. We opted to have IIS request a 2048-bit key. The same would apply for whatever computer, device, or software you are using to form the certificate request.
    Your message is pretty old, but I am running on the same problem right now. I've added a custom template to select (with 2048) minimum length, but the webpage from the IIS by default provides just 1024-bit. Where can i optimize the IIS to use a 2048-bit
    key when requesting the certificate?
    When I open the same site with Firefox for example, i got a listed option (Medium / High Strength) to choose for the encryption. It seems that the high strength is >= 2048-bit.

  • I do not have a SIZE menu option on my new message box and the photos keep resizing very small

    Mail keeps reducing the size of photos in messages. I do not have a menu bar at the bottom to allow changes to size. I cannot find anywhere to change or allow me to have a resize control.

    The problem is that I do not have a size control, pop-up or other to select. I noticed on another similiar discussion there was an option at the bottom of the page but mine has none. I have checked for updates for Mail but I have everything up to date. As a last resort should I re-install Mail. If so, how do you do this ???. Thanks Rick

  • File export size problem (PNG,JPG ....) - CS5

    I am using trial of Adobe Illustrator CS5.
    When ever I export file (RGB) to PNG or JPG format, there is size difference of 1px in width or hight or both.
    But when I save that file with Save for Web & Devices option, then there is no such issue.
    I have tested with so many files.
    I didn't faced such problem with Illustrator 4.

    I have looked all the option .... alignment, pixel grid , not frictional value ..... But still 1px difference.
    Now I have switched back to CS 4. For while till problem not solved.
    But there is issue. One more thing I am using Windows 7.

  • Problem with custom paper size on dot matrix printer

    Hi All,
    I'm using CR2008 with updated to SP2. I have a problem with custom paper size (W=21; H=14), the CR Viewer show report with custom paper size correctly but when I print it to a dot matrix printer (Epson LQ 300+) the content was rotated to landscape. If print to a laser printer the content was printed correctly. My report was printed correctly by CR10 or previous versions I got this issue when upgraded to CR2008. I aslo tested my computer and printer with orther application like MS Word the printing have no problem with custom paper size.
    Thanks for any advice for me.
    Han

    Looking at the Epson LQ 300+ driver, I see that the latest update is from 2002. In my experience, most matrix printer drivers are not unicode. Crystal Reports is designed to only work with unicode printer drivers. See the [How Printer Driver Options Affect a Report|https://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/a09051e9-721e-2b10-11b6-f9c65c64ef29&overridelayout=true] article, page 6 for details. Also, see [this|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_dev/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do] note.
    Finally, see if you can print from the CR designer to this printer and if you get the correct results here.
    Ludek

  • Problem with decreased font size in exported PDF.

    We have a web site running on a Windows 2008R2 server.
    The site was developed with Visual Studio 2010 using  .NET 4.0.and is running in 32bit. The associated application pool uses a specific local user.
    We have some reports that include a barcode font. The font is installed on the server and the reports are rendered in PDF on the server side to avoid the need to have the barcode font installed on all clients. The PDF renders correctly but we are facing the decreased font size problem
    We followed the instructions included in this post:
    Unfortunately the part regarding VS 2010 does not seem to work.
    If we add the specified Key on the HKLM section of the registry, it doesnu2019t have any effect.
    If we add it on the HKCU section while logged in with the same user assigned to the application pool, everything seems to work fine. But as soon as the user is logged out, the reports stop working.
    Have anybody figured out how to configure correctly those keys with this configuration?

    Try putting it under the HKU/.default path.  You can also use process monitor to see where the application is looking.

Maybe you are looking for

  • Hard drive will not mount after optical drive upgrade

    I recently performed an optical drive install. Had to remove the hard drive bays (I use three hard drives - Luckily, 2 run OSX). I carefully removed all three drive bays and the empty bay. When I inserted the drives into the computer I had changed th

  • Upgrading from Aperture 2: Trial or Buy?

    I already ordered Aperture 3 as an upgrade and am waiting for the box to arrive in a few days. Is it safe to download the trial in the meantime and upgrade or should I wait for the box? I seem to remember that when Aperture 2 came out there was a pro

  • DHCP: force router to assign predefined infinite DHCP address

    Does anyone know if its possible to force a router only to assign an infinite DHCP address when a client connect to the network? In the configuration (2911 router) there is an DHCP server configured which assigns specific IP addresses to certain mac

  • Promoting hatred in the forum

    Dear Moderator, This particular user is promoting hatred against a community with his abusive post here. Also he justifies it when warned to remove the content. Re: Please clarify these doubts........ I hope the modeator takes firm action in the best

  • I lost all my apps on iPad 2 and I can't even restore it. Help?

    Hello, Few days ago I was downloading an application but for some reason it kept freezing, so I thought I might just turn it off and on again. Once I turned it on again, ALL my apps were swiped clean... even the default apps like Settings or App Stor