Have JFrame respect the minimum size (stop resizing) - Partial solution

Hi
I remember I searched for a solution to make JFrame respect the minimum size of itself or it's components, but unfortunately there is no solution, at least not a satisfactory one.
The force-a-resize-if-it-gets-too-small "solution" looks really bad so I desided to drop the whole thing.
However I've been testing around with different Look & Feels and changing the layout, and what I discovered is that when setting setDefaultLookAndFeelDecorated(true) the minimum size is respected.
I haven't seen anyone mentioning this I thought I'd post it here.
import javax.swing.*;
import java.awt.*;
class RespectMinimumSize extends JFrame {
    RespectMinimumSize() {
     setMinimumSize(new Dimension(400, 400));
     setLocationRelativeTo(null);
     pack();
     setVisible(true);
    public static void main(String [] args) {
     JFrame.setDefaultLookAndFeelDecorated(true);
     JDialog.setDefaultLookAndFeelDecorated(true); // Works with JDialog as well
     Toolkit.getDefaultToolkit().setDynamicLayout(true);
     new RespectMinimumSize();
}

thanks - initial testing seems to work OK.
(I had to add a panel, to be able to set minimum size to the panel)

Similar Messages

  • How can I set the minimum size the location bar should automatically resize to

    I have moved all of my navigation buttons, location bar and tabs to be in line. This has been done to maximise the available space on screen.
    This works perfectly with two or three tabs open, but once more tabs are opened the location bar automatically shrinks to allow for more tabs and becomes unusable. I want to set the minimum size the location bar should shrink to but I do not know how to do this.
    [http://www.mediafire.com/imgbnc.php/eed5749531b3081c43186f59492500e5f089c498c0372fb6fa797b7d697826806g.jpg Screen shot displaying automatically resizing location bar]
    Any help would be appreciated.
    Thanks.

    FBZP seems to be the only way to do the minimum amout setting in standard SAP.
    You can check the BTE (Business transaction event) 00001820 for excluding the low amount items in F110. Please search SDn on how to use the BTEs.
    Regards,
    SDNer

  • Hi, My places.sqlite file size is 30,720 KB have I reached the maximum size, is there even a maximum size for this. Visited links are no longer changing color.

    Hi,
    My places.sqlite file size is 30,720 KB have I reached the maximum size, is there even a maximum size for this.
    Suddenly the visited links are no longer changing font color, as I am preparing for an exam I need visited questions to change color, to keep track of questions that I have finished. But if I delete a few days of history then again,a few more visited links change color then again it stops, so it seems something is getting full and not able to accommodate any more? Why are my visited links no longer changing color after a certain number of visits? I do have a back up of the places.sqlite file. So I have tried everything from deleting the profile, uninstalling reinstalling, creating a new profile, then copy pasting places.sqlite etc, but as mentioned after a few visits, visited links no longer change color, if I delete a few days of history then again a few visits will again change color and then stop again, so what should I increase so that my visited links quota is increased, I have also tried tweaking about:config and it has had no result. Although I was not really confident that increasing brower.history_max _pages (don't remember exact name, but I am sure you get the idea) is going to help.
    Seems as though my visited links change color, quota is full and only if I delete a few days of history will I get a few more visited links to change color. Can somebody shed some light? As mentioned my places.sqlite file size is 30,720 KB so I think perhaps this has something to do with this? Would really appreciate if someone could help. Thank you.

    There is no maximum for the places.sqlite database and other SQLite database files like I wrote above.<br />
    All SQLite database file have fixed minimum sizes and if they run out of space they are automatically increased in size with a specific chunk size. For places.sqlite this is 10 MB for the minimum and for the chunk.
    *Bug 581606 - Avoid sqlite fragmentation via SQLITE_FCNTL_CHUNK_SIZE

  • How to set the minimum size of app window?

    Hi JavaFX experts :)
    Is it possible to limit the minimum size of application window? What would be the JavaFX equivalent of the following SWING code?
            JFrame frame = new JFrame("Application Title");
            frame.setMinimumSize(new Dimension(320, 240));
            frame.setPreferredSize(new Dimension(640, 480));Preferred or initial size was easy (width/height), but what about the minimum size?
    Stage {
        title: "Application Title"
        width: 640
        height: 480
        scene: Scene {
            content: [
                // some content
    }Thanks!

    var stage: Stage;
    var stageWidth = stage.width on replace
        if (stageWidth < 640) stageWidth = 640;
    var stageHeight = stage.height on replace
        if (stageHeight < 400) stageHeight = 400;
    stage = Stage {
        title: "Application Title"
        width: bind stageWidth with inverse
        height: bind stageHeight with inverse
        scene: Scene {
            content: [
                // some content
    }It doesn't prevent resizing to smaller dimensions but it restores to minimal dimension if done.

  • How can I select the minimum size of Elements 10? It won't install due to lack of disk space on C:

    I have just purchased and downloaded Elements 10. Can't install it due to insufficient disk space on my C drive. I have enough space on my D drive, but it will not install there, probably because my sustem files are on C drive. The Install wisard does not provide for a selection of the size of Elements 10. Is there a way to select the minimum size? If so, how can I do this?

    There is not an option to customize the installation.  The system requirements for Photoshop Elements 10 request that you at least have 4 gigabytes free, plus more for installation, how much free space do you have on your C drive?

  • 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.

  • When I open Firefox 5.0.1 (using Windows XP Home), Firefox starts to open tab after tab automatically and I have to close the program to stop the proceeding misfunction! ??

    When I open Firefox 5.0.1 (using Windows XP Home), Firefox starts to open tab after tab automatically and I have to close the program to stop the proceeding misfunction! ??

    See [[Firefox keeps opening many tabs or windows]]

  • I have suddenly lost the brush size circle. How do I get it back?

    I have suddenly lost the brush size circle. How do I get it back?

    Is your caps lock on?
    If so, turn it off.

  • Is there a way to have Firefox respect the default audio output device when it has been changed while Firefox is open?

    I have been a Firefox user for many years and I still use it as my primary browser. One problem that has bothered me for years is the fact that when Firefox is open and I change my default audio output device, Firefox doesn't respect that change and continues playing audio through the device that was originally being used. Even if you stop the audio and continue playing, the output device doesn't change.
    Is there any way this can be configured in Firefox? Now if I listen to music online (e.g. Soundcloud) I always use Chrome since it's respects the default audio output device change even while in the middle of playing audio.
    Reproduce:
    1. Start playing audio (e.g. from a YouTube video; HTML5 and Flash are affected)
    2. Change your default audio output device
    3. Audio will continue to play from original output device
    Thanks!

    This is the same issue that has plagued me for years. I always thought that this was a Flash plugin issue, but it does occur on HTML5 as well. A friend of mine verified that this does not occur in Linux, but only on Windows. It would be great to have this fixed, as it's honestly the only thing that's making me use Chrome all the time, as I don't want to have multiple browsers open.

  • Does a text box for an ebook have to be the exact size?

    I'm using Indesign to create an ebook. The usable, non-bordered area of each page is 800 x 600.
    For each page I use the Type Tool button to allow me to create a text box that fills the page area of 800 x600 pixels. I go to great effort to make sure it is aligned perfectly and exactly the right size. I have slight muscular problems in my hands which makes them unsteady so I sometimes don't draw the box exactly the same size and have to undo it and start again a few times. It would be easier for me if I didn't have to be so precise.
    My question is if I used the Type Tool to draw a Text box that is bigger than the 800x600 page would this have repurcussions in how the ebook functions or displays or does it not make any difference?

    I've not been using Master Pages.
    I'm using Indesign to create an ebook which I will output an epub file.
    I set the page dimensions then I have been adding a page as I progress and then using the Type Tool to create a text box for each new page.
    So when you say 'ePub has no exact size predefined by the layouter it is like xhtml.' does this mean the text box size doesn't matter?

  • How to set the minimum size of the JDialog.

    Hi Could any one tell me ,
    How to set the minimmum size of the JDailog.
    I am using the JDialog's setMinimumSize(...)
    But it is not working.....
    Regards -
    Vikas Kumar sahu

    That's pretty much all there is, although you could always add a componentlistener and manually not let the size go below your minimum.
    Or you could try overriding setSize...

  • CS6 - The [ and ] keys stop resizing the brush

    I very recently installed CS6.  I have used Photoshop for years (CS5, CS3, CS, ...).
    Now under CS6 I find that periodically the [ and ] keys will not resize the brush.  I have to restart Photoshop to get them to work again.
    Anyone else seen this?  Is it a bug or is there something I can do to fix it?
    Thanks,
    Selby

    Boilerplate-text:
    Are Photoshop and OS fully updated and have you performed the usual trouble-shooting routines (trashing prefs by keeping command-alt-shift/ctrl-alt-shift pressed while starting Photoshop after making sure all customized presets like Actions, Patterns, Brushes etc. have been saved and making a note of the Preferences you’ve changed, 3rd party plug-ins deactivation, system maintenance, cleaning caches, font validation, etc.)?

  • How to set the minimum size of a JFrame.

    I can user JFrame.setMinimumSize() method with jdk1.6.0. But I can't find this method in jdk1.4.2. How can I do this with jdk1.4.2?

    Try google:
    http://www.google.com/search?q=jframe+minimum+size

  • Need query to find the minimum size of a datafile

    Hi All,
    I need to reduce the size of a datafile. Before that i need to find out  how far i can reduce the size of the datafile. Please help
    DB version:11.2.0.3
    OS:AIX 6.1

    Below SQL will ask you blocksize (I guess it is default i.e. 8192) :
    select 'alter database datafile '''||file_name||''' resize ' ||
               ceil( (nvl(hwm,1)*&&blksize)/1024/1024 ) || 'm;' cmd
    from dba_data_files a,
    ( select file_id, max(block_id+blocks-1) hwm
                 from dba_extents
                group by file_id ) b
    where a.file_id = b.file_id(+)
    and ceil( blocks*&&blksize/1024/1024) -
    ceil( (nvl(hwm,1)*&&blksize)/1024/1024 ) > 0
    It will tell you upto how much extend you can shrink your datafile.
    Regards
    Girish Sharma

  • I have problem with The text size during the last weeks.

    My IPad 2 is a little weird. During the last weeks it seems it works ok, and suddenly text size, icons size grow very big and it takes me ages to get my IPad back to its original size. Is this happening to anyone?

    Short of something that might be going on with the settings, have you tried a reset of the iPad?
    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the button.
    In the event that something wonky is going on with your settings you can try Settings>General>Reset>Reset all settings. No data will be lost but all settings will have to be entered again.

Maybe you are looking for

  • Problems with creating a complex cursor

    Let me prefix this post with the fact that I am really new at this and this is my first shot at creating a Stored Proc. I have the shell and I have tried to code this but I am having some issues with the cursor. Any tips or tricks that you can give m

  • Oracle Not Availible Error - Window Vista 11g

    Hi, I am having difficulties. I log onto Oracle as sysdba. I am trying to change my oracle SYSTEM password and I get this error: ORA-01034: ORACLE not available Any help would be appreciated greatly appreciated! thanks

  • Anyone else having trouble with push mail?

    Yahoo and Outlook mail push have not worked the past several days. Yahoo mail has been stuck on 'downloading message 1 of 70' and sticks and Outlook mail is functioning more like manual fetch. I have deleted and reinstalled both accounts, restored fr

  • I updated my MacBook to 10.6.8 and cannot print.

    Last week I updated my OS and since then haven't been able to print.  My printer is a HP Oficejet Pro 8600 but I don't think that makes any difference since other people have had this issue with several different brands of printers.  I've downloaded

  • ILife '09 - problems with spotlight preferences after install

    +I also posted this over in the iLife forum, but had to post in the iPhoto topic because Apple doesn't have a general iLife topic. Posting again here because the issue is more directly related to spotlight, I just think iLife '09 install had somethin