JFrame not showing the whole JPanel

Hi,
I have a JPanel with a few buttons on it(using flowlayout). I added the JPanel to a JFrame. I want to prevent the JFrame from resizing to a size which hides the buttons on the JPanel. Is there any way to do it without explicitly specifing the size of the JFrame. I want the JFrame to automatically see that all the components of the JPanel won't be displayed if it's size is reduced. Hence don't allow resize.

If you still want to resize larger (just not smaller) you could do something like this:
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
public class Resize {
    public static void main(String [] args) {
        JFrame f = new JFrame("Resize Test");
        JPanel p = new JPanel();
        p.add(new JButton("Button1"));
        p.add(new JButton("Button2"));
        p.add(new JButton("Button3"));
        p.add(new JButton("Button4"));
        p.add(new JButton("Button5"));
        f.getContentPane().add(p);
        f.pack();
        f.setVisible(true);
        final Dimension minSize = f.getSize();
        f.addComponentListener(new ComponentAdapter() {
            public void componentResized(ComponentEvent e) {
                Dimension d = ((JFrame) e.getSource()).getSize();
                if (d.width < minSize.width)
                    ((JFrame) e.getSource()).setSize(minSize.width, d.height);
}Matt

Similar Messages

  • LastDialogtext does not show the whole file path

    I am tring to get the file path for a dialog using rswapp.LastDialogtext. The value returned is shown as "M:\Regression_Tests\...\ASDERV.xls". The actual file path is "M:\Regression_Tests\SA!\SA Reports Test\ASDERV.xls". How can I get the full file path?

    I am not doing anything really different when I am trying to capture that dialog. The dialog is generated when I press a button and tries to create a report. Before showing it in that dialog, it displays three other common IE dialogs Save, SaveAs and Close. All those are dismissed using Dialog Manager. This dialog is finally closed by clicking the X on the dialog. I am checking for its path before it closes using LastDialogText, which is not shown completely.
    Message was edited by:
    mpalivela

  • CRM 2007 Business Role IC_AGENT not showing the whole screen

    Hi,
    I set up CRM 2007 successful for a couple of standard roles like TPM_PRO, SALESPRO and SERVICEPRO. The system is working fine. Assigning the business role IC_AGENT is showing me an uncomplete screen. The area for navigation bar, the account info, the alerts and the communication information is blank. Has somebody an idea what is wrong?
    Thanks and best wishes,
    Andreas

    Hi Prasoon,
    unfortunatly I cannot help you. It is still not working. Luckly was that CRM 2007 we were just preparing for demonstration. So at the end we showed something different.
    But next step what I would do is open an OSS message due to the fact that it is a standard role and it has to work.
    Best regards,
    Andreas

  • Monitor not showing the whole screen when I log out of Xorg/Openbox

    Please help, what happens is..
    I log into arch, it boots fine (it displays the loading of daemons in like arabic or something but that's another matter!), I can see everything, I 'startx' into Openbox and that's all fine but when I log out of X it cuts off the bottom of my screen.
    I've got a widescreen 1680x1080 monitor and an Nvidia GeForce 8400 GS graphics card and I've tried using nvidia and nouveau drivers.
    It only started AFTER i'd installed Xorg, I'd just log into x then kill it and i'd have half my screen missing.
    I've tried setting nvidia-settings and editing the conf files in Xorg but it must be an issue outside of X surely, as It's always fine in openbox?
    any ideas?
    Thanks.
    EDIT: I did try searching but to no avail - if there's a topic on this i'm very sorry =/
    Last edited by teatreetea (2011-01-12 15:28:07)

    I don't know how to do the nested scroll thing I'm sorry
    /var/log/Xorg.0.log
    [ 3557.788] (II) Loading extension DOUBLE-BUFFER
    [ 3557.788] (II) LoadModule: "record"
    [ 3557.788] (II) Loading /usr/lib/xorg/modules/extensions/librecord.so
    [ 3557.788] (II) Module record: vendor="X.Org Foundation"
    [ 3557.788] compiled for 1.9.2, module version = 1.13.0
    [ 3557.788] Module class: X.Org Server Extension
    [ 3557.788] ABI class: X.Org Server Extension, version 4.0
    [ 3557.788] (II) Loading extension RECORD
    [ 3557.788] (II) LoadModule: "extmod"
    [ 3557.788] (II) Loading /usr/lib/xorg/modules/extensions/libextmod.so
    [ 3557.788] (II) Module extmod: vendor="X.Org Foundation"
    [ 3557.788] compiled for 1.9.2, module version = 1.0.0
    [ 3557.788] Module class: X.Org Server Extension
    [ 3557.788] ABI class: X.Org Server Extension, version 4.0
    [ 3557.788] (II) Loading extension MIT-SCREEN-SAVER
    [ 3557.788] (II) Loading extension XFree86-VidModeExtension
    [ 3557.788] (II) Loading extension XFree86-DGA
    [ 3557.788] (II) Loading extension DPMS
    [ 3557.788] (II) Loading extension XVideo
    [ 3557.788] (II) Loading extension XVideo-MotionCompensation
    [ 3557.788] (II) Loading extension X-Resource
    [ 3557.788] (II) LoadModule: "glx"
    [ 3557.789] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
    [ 3557.799] (II) Module glx: vendor="NVIDIA Corporation"
    [ 3557.799] compiled for 4.0.2, module version = 1.0.0
    [ 3557.799] Module class: X.Org Server Extension
    [ 3557.799] (II) NVIDIA GLX Module 260.19.29 Wed Dec 8 12:24:30 PST 2010
    [ 3557.799] (II) Loading extension GLX
    [ 3557.799] (II) LoadModule: "dri"
    [ 3557.799] (II) Loading /usr/lib/xorg/modules/extensions/libdri.so
    [ 3557.800] (II) Module dri: vendor="X.Org Foundation"
    [ 3557.800] compiled for 1.9.2, module version = 1.0.0
    [ 3557.800] ABI class: X.Org Server Extension, version 4.0
    [ 3557.800] (II) Loading extension XFree86-DRI
    [ 3557.800] (II) LoadModule: "dri2"
    [ 3557.800] (II) Loading /usr/lib/xorg/modules/extensions/libdri2.so
    [ 3557.800] (II) Module dri2: vendor="X.Org Foundation"
    [ 3557.800] compiled for 1.9.2, module version = 1.2.0
    [ 3557.800] ABI class: X.Org Server Extension, version 4.0
    [ 3557.800] (II) Loading extension DRI2
    [ 3557.800] (II) LoadModule: "nvidia"
    [ 3557.800] (II) Loading /usr/lib/xorg/modules/drivers/nvidia_drv.so
    [ 3557.801] (II) Module nvidia: vendor="NVIDIA Corporation"
    [ 3557.801] compiled for 4.0.2, module version = 1.0.0
    [ 3557.801] Module class: X.Org Video Driver
    [ 3558.216] (II) NVIDIA dlloader X Driver 260.19.29 Wed Dec 8 12:10:14 PST 2010
    [ 3558.216] (II) NVIDIA Unified Driver for all Supported NVIDIA GPUs
    [ 3558.216] (--) using VT number 8
    [ 3558.220] (II) Loading sub module "fb"
    [ 3558.220] (II) LoadModule: "fb"
    [ 3558.220] (II) Loading /usr/lib/xorg/modules/libfb.so
    [ 3558.221] (II) Module fb: vendor="X.Org Foundation"
    [ 3558.221] compiled for 1.9.2, module version = 1.0.0
    [ 3558.221] ABI class: X.Org ANSI C Emulation, version 0.4
    [ 3558.221] (II) Loading sub module "wfb"
    [ 3558.221] (II) LoadModule: "wfb"
    [ 3558.221] (II) Loading /usr/lib/xorg/modules/libwfb.so
    [ 3558.221] (II) Module wfb: vendor="X.Org Foundation"
    [ 3558.221] compiled for 1.9.2, module version = 1.0.0
    [ 3558.221] ABI class: X.Org ANSI C Emulation, version 0.4
    [ 3558.221] (II) Loading sub module "ramdac"
    [ 3558.221] (II) LoadModule: "ramdac"
    [ 3558.221] (II) Module "ramdac" already built-in
    [ 3558.221] (II) NVIDIA(0): Creating default Display subsection in Screen section
    "Screen0" for depth/fbbpp 24/32
    [ 3558.221] (**) NVIDIA(0): Depth 24, (--) framebuffer bpp 32
    [ 3558.221] (==) NVIDIA(0): RGB weight 888
    [ 3558.221] (==) NVIDIA(0): Default visual is TrueColor
    [ 3558.221] (==) NVIDIA(0): Using gamma correction (1.0, 1.0, 1.0)
    [ 3558.221] (**) NVIDIA(0): Enabling RENDER acceleration
    [ 3558.222] (II) NVIDIA(0): Support for GLX with the Damage and Composite X extensions is
    [ 3558.222] (II) NVIDIA(0): enabled.
    [ 3559.086] (II) NVIDIA(0): NVIDIA GPU GeForce 8400 GS (G98) at PCI:1:0:0 (GPU-0)
    [ 3559.086] (--) NVIDIA(0): Memory: 524288 kBytes
    [ 3559.086] (--) NVIDIA(0): VideoBIOS: 62.98.71.00.52
    [ 3559.086] (II) NVIDIA(0): Detected PCI Express Link width: 16X
    [ 3559.086] (--) NVIDIA(0): Interlaced video modes are supported on this GPU
    [ 3559.086] (--) NVIDIA(0): Connected display device(s) on GeForce 8400 GS at PCI:1:0:0
    [ 3559.086] (--) NVIDIA(0): NTS MBW-SERIAL (CRT-1)
    [ 3559.086] (--) NVIDIA(0): NTS MBW-SERIAL (CRT-1): 400.0 MHz maximum pixel clock
    [ 3559.136] (II) NVIDIA(0): Assigned Display Device: CRT-1
    [ 3559.136] (==) NVIDIA(0):
    [ 3559.136] (==) NVIDIA(0): No modes were requested; the default mode "nvidia-auto-select"
    [ 3559.136] (==) NVIDIA(0): will be used as the requested mode.
    [ 3559.136] (==) NVIDIA(0):
    [ 3559.136] (II) NVIDIA(0): Validated modes:
    [ 3559.136] (II) NVIDIA(0): "nvidia-auto-select"
    [ 3559.136] (II) NVIDIA(0): Virtual screen size determined to be 1680 x 1050
    [ 3559.172] (--) NVIDIA(0): DPI set to (90, 88); computed from "UseEdidDpi" X config
    [ 3559.172] (--) NVIDIA(0): option
    [ 3559.172] (==) NVIDIA(0): Enabling 32-bit ARGB GLX visuals.
    [ 3559.172] (--) Depth 24 pixmap format is 32 bpp
    [ 3559.172] (II) NVIDIA: Using 768.00 MB of virtual memory for indirect memory access.
    [ 3559.174] (II) NVIDIA(0): Initialized GPU GART.
    [ 3559.182] (II) NVIDIA(0): ACPI: failed to connect to the ACPI event daemon; the daemon
    [ 3559.182] (II) NVIDIA(0): may not be running or the "AcpidSocketPath" X
    [ 3559.182] (II) NVIDIA(0): configuration option may not be set correctly. When the
    [ 3559.182] (II) NVIDIA(0): ACPI event daemon is available, the NVIDIA X driver will
    [ 3559.182] (II) NVIDIA(0): try to use it to receive ACPI event notifications. For
    [ 3559.182] (II) NVIDIA(0): details, please see the "ConnectToAcpid" and
    [ 3559.182] (II) NVIDIA(0): "AcpidSocketPath" X configuration options in Appendix B: X
    [ 3559.182] (II) NVIDIA(0): Config Options in the README.
    [ 3559.187] (II) NVIDIA(0): Setting mode "nvidia-auto-select"
    [ 3559.254] (II) Loading extension NV-GLX
    [ 3559.278] (II) NVIDIA(0): Initialized OpenGL Acceleration
    [ 3559.283] (==) NVIDIA(0): Disabling shared memory pixmaps
    [ 3559.283] (II) NVIDIA(0): Initialized X Rendering Acceleration
    [ 3559.283] (==) NVIDIA(0): Backing store disabled
    [ 3559.283] (==) NVIDIA(0): Silken mouse enabled
    [ 3559.290] (==) NVIDIA(0): DPMS enabled
    [ 3559.290] (II) Loading extension NV-CONTROL
    [ 3559.291] (II) Loading extension XINERAMA
    [ 3559.291] (II) Loading sub module "dri2"
    [ 355/var/log/Xorg.0.log
    [ 3559.767] (**) AT Translated Set 2 keyboard: always reports core events
    [ 3559.767] (**) AT Translated Set 2 keyboard: Device: "/dev/input/event0"
    [ 3559.786] (--) AT Translated Set 2 keyboard: Found keys
    [ 3559.786] (II) AT Translated Set 2 keyboard: Configuring as keyboard
    [ 3559.786] (II) XINPUT: Adding extended input device "AT Translated Set 2 key$
    [ 3559.786] (**) Option "xkb_rules" "evdev"
    [ 3559.786] (**) Option "xkb_model" "evdev"
    [ 3559.786] (**) Option "xkb_layout" "us"
    [ 3559.787] (II) config/udev: Adding input device PC Speaker (/dev/input/event$
    [ 3559.787] (II) No input driver/identifier specified (ignoring)
    mod edit: code tags
    Last edited by litemotiv (2011-01-12 16:12:59)

  • Pogo games load small does not show the whole game can not play

    when i download pogo games only half the game shows i try stretching it but it is blank how do i enlarge the percentage of the game to 100% so i can play then i have uninstalled firefox and reinstalled it but the problem still exists thank you

    when i download pogo games only half the game shows i try stretching it but it is blank how do i enlarge the percentage of the game to 100% so i can play then i have uninstalled firefox and reinstalled it but the problem still exists thank you

  • Menubar not showing the whole menu

    Hi.
    I have a problem with Menubar.
    I use Flex SDK 3.0.0
    The problem is when a child node has childs the child node
    will be removed.
    My XML look like this. *edit*
    <menuItem label="A">
    <menuItem label="A1">
    <menuItem label="A11">
    <menuItem label="A111"/>
    <menuItem label="A112"/>
    </menuItem>
    </menuItem>
    </menuItem>
    And the result will be A-->A1-->A111
    How can i do so i can see the correct result
    A-->A1-->A11-->A111
    When i do like this its work.
    <menuItem label="A">
    <menuItem label="A1">
    <menuItem label="A11">
    <menuItem label="A111"/>
    <menuItem label="A112"/>
    </menuItem>
    <menuItem label="A12"/>
    </menuItem>
    </menuItem>
    How can i do?

    I was in a hurry when i wrote the post. now i have edit it so
    i looks right.
    But the problem is there anyway.
    quote:
    Originally posted by:
    rtalton
    I'm stumped. I tried various things and got the same results
    as you.
    I also tried examples in the help docs; none of them had an
    example of children being nested more than two deep. Nesting three
    deep (A, A1, A11), "A11" disappears on me.
    btw, your example xml has the tag <menuItem
    label="A111"/> twice. This is an error.
    I used the following xml:
    <menuitems>
    <menuitem label="A">
    <menuitem label="A1">
    <menuitem label="A11">
    <menuitem label="A111">
    </menuitem>
    </menuitem>
    </menuitem>
    </menuitem>
    </menuitems>

  • Gmail contact manager does not show the whole page, right side is cut off.

    I use Gmail which seems to have few problems with Firefox 4.0, however, when using the Contact Manager the page runs off the screen and there appears to be no way to adjust the page size in Gmail to fit the Firefox layout. Is there a fix for this?

    Thanks. I had already found the same solution you found. I think the problem occurred when Firefox upgraded and my settings got changed.

  • When I get on facebook, i can not see the whole picture even if I turn it sideways. It has not done this till here recently. What do I do?

    When I get on facebook, it will not show the whole picture on anything, even when I turn it sidways. What do I do?

    Steve MacGuire a.k.a. turingtest2 - iTunes & iPod Hints & Tips - Grouping Tracks Into Albums - http://www.samsoft.org.uk/iTunes/grouping.asp (older post on Apple Discussions http://discussions.apple.com/message/9910895)
    Quick answer:  Select all the tracks on the album, File > get info, and either give them all a single "album artist", or check the "compilation" flag (as in https://discussions.apple.com/message/17670085).
    If these are from multiple-CD sets you may also need to enter the appropriate information in the disc number fields.  If they are not a multiple CD set you still need to make sure the disc number fields are set correctly or all empty.

  • I can not read my mails on my email screen. It does not show the messagew

    Although te massages are showen in brief at hè leeft, the screen does not show THE whole message,

    Try closing the Mail app completely and see if the email text shows when you re-open it : from the home screen (i.e. not with the Mail app 'open' on-screen) double-click the home button to bring up the taskbar, then press and hold any of the apps on the taskbar for a couple of seconds or so until they start shaking, then press the '-' in the top left of the Mail app to close it, and touch any part of the screen above the taskbar so as to stop the shaking and close the taskbar.
    If that doesn't fix it then try a reset : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear - you won't lose any content, it's the iPad equivalent of a reboot.

  • HT4623 How do I get the calendar to show the whole month and not just the day or week.

    How do I get the calendar on my updated i phone 7 to show the whole month and not just the week or the day?

    Touch the arrow (or word) at upper left (e.g. September).

  • Why did the trace NOT show the other switches in between?

    I have a PC that is connected to a switch (A) in a network. Switch A has many switches in between and connects to another switch B. When I did a trace to the server, the last switch I see in the result is switch B. Also, when I checked to which port of switch B that the server was connected, It showed as Po1. When I did a show cdp neighbor for the interfaces for the interfaces involved inthe bundle, I get a switch and then another. Why did the trace NOT show the other switches in between? Why did I get an arp on Switch B? Could some one explain?

    It's hard to tell, but if you have L2 switches, the addresses on those L2 switches are for management purposes only and you won't see a response from a trace. The only time you'll see a response is when the packet is routed between devices and not switched. You'll get an arp request/response across a single vlan. If you have vlan 10 across 10 switches, all 10 switches will see an arp request because they're broadcasted throughout the whole vlan.
    HTH,
    John
    *** Please rate all useful posts ***

  • HT204022 I have iPhoto, iOS, etc. all up to date.... however my iPad, iPhone, and Mac PhotoStreams all contain different pictures and aren't the same. Any ideas why? I'd rather not reset the whole thing if I don't have too.

    I have iPhoto, iOS, etc. all up to date.... however my iPad, iPhone, and Mac PhotoStreams all contain different pictures and aren't the same. Any ideas why? I'd rather not reset the whole thing if I don't have too.

    OK, restart in Safe Mode, this will clear some caches. It's possible one or more is corrupt. To restart in Safe Mode when you hear the start up tone hold down the Shift Key until you see a progress bar. Let it fully boot then restart normally and test.
    Also I am assuming you have checked Finder - Preferences  - General and see what boxes are checked in "Show these items on desktop." You can also mount an item in Disk Utility, simply highlight it and then look in the File menu for Mount.....

  • Not showing the Data in VC application

    Hi I have developed the application in VC.
    It is showing the data some times , it is not showing the data. Can u please let me know what is the problem.
    when i checked using the Test Data service . It is showing the data. Then i have developed step by step, in between the time i use to run the application , it was showing the data. finally i have assigned to some role and user id. then also it is showing the data.
    Next day after i run the application , it is not  showing the data. displaying the message .
    "No Data Found".
    But when i run  the BAPI at the back end R/3 it is giving the data properly.
    Can u tell me what might be the problem
    REgards
    Vijay

    Hi Krishna,
    check the logs in the NWA. It seems that your connection is broken down sometimes, maybe a timeout. How many records does your data service return?
    Check it with external debugging of the BAPI, when you can reconstruct the error.
    Best Regards,
    Marcel

  • Field Explorer in Crystal Reports does not show the same names as Bex Query

    Hi
    I have crystal reports, I can retrieve data from BW Bex Query. But in the field explorer it does not show the names as in the Bex query designer.
    In the Bex query designer a field will have the following technical name 0Debitor and the description is Customer.
    It shows in crystal reports in the field explorer twice as D[0DEBITOR]D and D[0DEBITOR]D. It also does not seperate key figures and characteristics.
    I would like it to display the field explorer as shown in this blog.
    /people/ingo.hilgefort/blog/2008/02/19/businessobjects-and-sap-part-2
    Thanks in advance

    Hi,
    take a look here:
    /people/ingo.hilgefort/blog/2008/02/19/businessobjects-and-sap-part-2
    make sure you are using the MDX Driver and what happens is that you will see several fields per characteristic. example: one for the key, one for the description, several if modelled for the display attributes
    Ingo

  • HT1338 i lost my iphone and my macbook pro does not show the icloud in system pref. What do i do? how do i download icloud?

    I lost my iphone and my macbook pro does not show the icloud in system pref. how do i get icloud on my mac?

    iCloud is only available in Lion, 10.7. You will have to upgrade to Lion in order to get into iCloud. If you transfered a .mac or .me address to iCloud through mobile me, or you have another device iCloud enabled, then you can log into the iCloud.com website.

Maybe you are looking for

  • Error in scheduling parameters for production orders

    Hi Guys, Greeting for the day u2026u2026u2026. I am trying to create production orders creation for own order  type ex MM01, but I am getting error message as u201C scheduling parameters are not defined for the order type u201C even though I have mai

  • How do I stop my text/imessages from going to my iMac?  I don't mind them going to the iPad, but not my iMac.

    When I receive a message on my phone, it also pops up on my iMac and iPad.  I don't mind it on the iPad, but I prefer that it doesn't come through the iMac.  How do I stop this?

  • Flash components in  VC

    We upgraded to EHP1 SP6 to get the flash component working in VC. I uploaded the BO flash meters I found in a PDF  (/people/amir.mimran/blog/2009/09/11/flash-components-for-visual-composer-70--flexibility-is-the-name-of-the-game) I can add them to th

  • I'm setting up my new iphone

    So I'm setting up my new iphone and i accidentally clicked sync from ipod instead of ipad. How do i swich it?

  • How to connect to Samsung Synmaster monitor?

    I am decidedly NON-tech savvy, and I'm looking for instructions for "the complete dummy."  I have a MacBook OS X 10.5.8 laptop that I want to connect up to a new Samsung Syncmaster SA300 LED computer monitor.  It is supposed to be "compatible for Mac