How Do You Set a JFrame's Maximum Size?

Can someone show me a quick example? The JFrame can be empty, I just want to know how to set it's maximum size. I tried using setMaximumSize() and it doesn't work for some reason but setMinimumSize() works fine.
I tried it using a BoxLayout and even using null as a layout manager and can't get it to work. I heard that the other layout managers don't allow you to set the maximum size of a JFrame so that is why I tried it with the layouts that I did.

Darryl.Burke wrote:
Are you displaying your MyFrame as a top-level window or adding it to a parent JFrame with null or BoxLayout set?
Maybe the method you're looking for is setMaximizedBounds(Rectangle bounds)
You could also try this: setBackground(...) to something other than the default background and run your program again.
I'm at work and can't try ou any of my suggestions, so please post back if you get any progress.
dbsetMaximizedBounds is a little better but not really what I was looking for. I can still make the window go passed the set boundaries when the window hasn't been maximized.
Also, I checked that method setBackground, that only seems to change the color, is that the same method you were referring to?

Similar Messages

  • How can you set (or reset) different page sizes within 1 pdf?

    I am working on a pdf with various page sizes.  Say one page at 8-1/2 x 11, another at 11 x 17, and another at 22 x 34.  I obviously can't print as "Choose paper source by PDF page size" as one printer can't do all sizes.  I would like to change the 22 x 34 to 11 x 17.  How can I change the page size setting of one page within a multiple-paged pdf?

    You can play with the Crop tool. You'll find it is easier to "size up" than "size down".
    May have to extract and bin PDF pages by the virtual page size then work on them.
    However, if all you want is to have the content on hard copy and having that on a common sheet size (say Letter) then consider this alternative:
    Make a working copy of the PDF.
    With the PDF open in Acrobat, open the Pages panel. Expand the panel width as desired.
    Now, Ctrl click through the PDF page thumbnails that have a landscape orientation.
    Rotate these 90 degrees to a portrait orientation.
    Alt+D+T or Shift+Ctrl+R
    Save as you go.
    With all pages in a portrait orientation, use the attached printer to print.
    In the Print dialog locate the entry for 'page scaling' and select Fit or Shrink to Printable Area.
    All PDF pages' content will be scaled such that all page content fits in an imprint on the Letter size paper.
    Or, go the other way and have the imprint of PDF page content fill a larger sheet size.
    Just a function of what the printer accepts for paper size and the features provided in the printer driver.
    Be well....

  • How do you set an image into the background of a JPanel or JFrame?

    How do you set an image into the background of a JPanel or JFrame?

    Something like this, Ive thrown in an ImageIcon on a
    button too for good measure.
    import java.awt.*;
    import javax.swing.*;
    public class JFrameImage extends JFrame {
    public JFrameImage() {
    Container c    = getContentPane();
    JPanel panel = new JPanel(){
                 public void paintComponent(Graphics g)     {
    ImageIcon img = new
    = new ImageIcon("background.jpg");
                      g.drawImage(img.getImage(), 0, 0, null);
                      super.paintComponent(g);
            panel.setOpaque(false);
    ImageIcon icon = new ImageIcon("onButton.jpg");
    JButton button = new JButton(icon);
    panel.add(button);
    c.add(panel);
    public static void main(String[] args) {
    JFrameImage frame = new JFrameImage();
    frame.setSize(200,200);
    frame.setVisible(true);
    Going totally fancy pants
    ImageIcon bigImage = new ImageIcon(bgImage.getImage().getScaledInstance(getWidth(), getHeight(),Image.SCALE_REPLICATE));
    g.drawImage(bigImage.getImage(), 0, 0, this); Will scale the image to the size of the panel
    whereas
    for (int y = 0; y  < getHeight(); y = y + image.getHeight(null))
    for (int x = 0; x< getWidth(); x = x + image.getWidth(null))
    g.drawImage(image, x, y, this); Will give a tiled effect
    Try tiling with an animated gif and bring your processor to a standstill.

  • How can you set the max row for a 'open cursor' in a stored proc?

    I would like to know how can you set the maximum amount of row returned in a resultset coming from a stored proc?
    You can do it via JDBC with cStatement.setMaxRows(10); but it works only for select that you do via JDBC...
    I would like the same functionality using open cursor inside a stored proc...
    Thanks...

    is "where ROWNUM <= 10" the equivalent of "cStatement.setMaxRows(10);" because the ROWNUM as problem with the ORDER BY clause and the setMaxRows() as no problem...

  • How do I use the time capsule to share itunes music between multiple apple devices? Also, is it possible to control the music on one device using another, and how do you set this up?

    How do I use the time capsule to share itunes music between multiple apple devices? Also, is it possible to control the music on one device using another, and how do you set this up?

    unless i'm missing something, i think you got mixed up, this is easy google for walk throughs
    i'm assuming this is the new 3tb tc AC or 'tower' shape, if so, its wifi will run circles around your at&t device
    unplug the at&t box for a minute and plug it back in
    factory reset your tc - unplug it, hold down reset and keep holding while you plug it back in - only release reset when amber light flashes in 10-20s
    connect the tc to your at&t box via eth in the wan port, wait 1 minute, open airport utility look in 'other wifi devices' to setup the tc
    create a new wifi network (give it a different name than your at&t one) and put the tc in bridge mode (it may do this automatically for you, but you should double check) under the 'network' tab
    login to your at&t router and disable wifi on it
    add new clients to the new wifi network, and point your Macs to the time machine for backups

  • How do you set up Port Forwarding for ARD 2.2 in AEB N?

    Help,
    I'm a novice at Apple Remote Desktop (ARD) - not an IT guy, so it has to be pretty basic and detailed.
    How do you set up Port Forwarding for ARD 2.2 on the Apple Airport Extreme BS router, 802.11 N. I have one at each end of the internet connection. At one end I have an Airport Extreme N router with 2 macs and eventually 1 windows XP machine (if I can) that I would like to be able to connect to over the interenet (the clients) and at the other end, I have a Mac with ARD 2.2 installed also with an Airport Extreme N router. Note: Both routers use Static IP addresses and all computers use static IP's internally not through DHCP. What are the settings or directions to do this.
    I have read and printed out the directions for Configuration of ARD 3.0 that are posted many times in the ARD discusion group, but it uses a Linksys router ( http://www.starkpr.com/ard.htm posted by Dave Sawyer). The Mac router is different, particularly with the place to set a Private IP address. I'm not sure about alot of things, but especially about the Private IP address, what number do I set it to, the one that is in my Network connections list? It automatically changes to a different number in AE N setup for Port Forwarding (by one) as if it is not suppose to the same?????
    Are there any directions available that are as straight forward for the Airport Extreme N router, as the one's that are listed here for the Linksys Router's? ( http://www.starkpr.com/ard.htm )
    Any and All help will be greatly appreciated.
    P.S. I know I should have 3.0 but bought 2.2 just weeks before 3.0 came out and they would not give me an upgrade price, so I'm waiting for 4.0 to upgrade.
    Thanks,
    Jim

    Try the following for each AirPort Extreme ...
    AEBSn - Port Mapping Setup
    To setup port mapping on an 802.11n AirPort Extreme Base Station (AEBSn), either connect to the AEBSn's wireless network or temporarily connect directly, using an Ethernet cable, to one of the LAN port of the AEBSn, and then use the AirPort Utility, in Manual Setup, to make these settings:
    1. Reserve a DHCP-provided IP address for the host device.
    Internet > DHCP tab
    o On the DHCP tab, click the "+" (Add) button to enter DHCP Reservations.
    o Description: <enter the desired description of the host device>
    o Reserve address by: MAC Address
    o Click Continue.
    o MAC Address: <enter the MAC (what Apple calls Ethernet ID if you are using wired or AirPort ID if wireless) hardware address of the host computer>
    o IPv4 Address: <enter the desired IP address>
    o Click Done.
    2. Setup Port Mapping on the AEBSn.
    Advanced > Port Mapping tab
    o Click the "+" (Add) button
    o Service: <choose the appropriate service from the Service pop-up menu>
    o Public UDP Port(s): 3283
    o Public TCP Port(s): 3283
    o Private IP Address: <enter the IP address of the host server>
    o Private UDP Port(s): 3283
    o Private TCP Port(s): 3283
    o Click "Continue"
    o Click the "+" (Add) button
    o Service: <choose the appropriate service from the Service pop-up menu>
    o Public UDP Port(s):
    o Public TCP Port(s): 5900
    o Private IP Address: <enter the IP address of the host server>
    o Private UDP Port(s):
    o Private TCP Port(s): 5900
    o Click "Continue"
    o Click the "+" (Add) button
    o Service: <choose the appropriate service from the Service pop-up menu>
    o Public UDP Port(s):
    o Public TCP Port(s): 5988
    o Private IP Address: <enter the IP address of the host server>
    o Private UDP Port(s):
    o Private TCP Port(s): 5988
    o Click "Continue"
    (ref: "Well Known" TCP and UDP ports used by Apple software products)

  • How do you set up multiple accounts in itunes so phones don't automatically sync each others data ?

    How do you set up multiple itunes accounts to prevent multiple phones from sharing contact data?

    To add to Rod's answer, I have been blogging to explain more in detail the work flows for Question and Score slides, and some tweaking possibilities in these articles:
    http://lilybiri.posterous.com/question-question-slides-in-captivate
    http://lilybiri.posterous.com/question-question-slides-part-2
    Lilybiri

  • How do you Set up a Family Pack sub-account

    how do you Set up a Family Pack sub-account i have purchased a Family Pack account and enter the activation key and i can not find where to set up the sub-account.
    please help
    Denis

    Thanks Shepart
    when i activated the account i ticked the upgrade button, should i have ticked the new account button?
    anyway, when i do what you say (below) there is not a manage "Accounts button" so i went to reactive it again ( for a new account) and is says that the activation key is all ready in use.
    Denis, go to www.mac.com and sign into your account. Click on the word "Account" at the top of the left hand column. You will need to sign in again for security purposes. Once your account settings show up, click on the "Manage Accounts" button and you can take care of everything.
    i think i hit a brick wall !!
    Cheers
    Denis

  • How do you set up separate facetime accounts under one apple id

    how do you set up separate facetime accounts under one apple id

    This is possible, but I haven't found any official Apple topics about it, so I will share a nice web article about it on a Mac fan website:
    http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l
    Hope this helped!

  • How do you set up iphone 5? everytime i put it into the computer it erases all my contacts how do i stop this and get my contacts back?

    how do you set up a iphone 5 everytime i conect it to the computer it erases all my contacts how do i put them back on my phone and stop the computer erasing them again?

    Are your contacts not on your computer?

  • How do you set up two different ipads on one computer ?

    I purchased a new ipad for my wife and want to get her started but we both use one imac as our desktop system.  How do you set up two different uses on one computer.
    Thanks,
    Dave

    Other options not covered in the article:
    1) You can plug both in under the same computer username and same iTunes Apple ID and give each device it's own name. You should be able to manage them as separate devices with different media, apps and screen layouts. All of your media would be in a common pool, though.
    2) Under one computer username, you can login and logout of two different iTunes Apple IDs. This option is cleaner with two computer usernames but it can be done with one.

  • How do you set NLS_LANG environment variable in report builder

    How do you set up the reports builder environment to display foreign fonts.
    So far what I read makes me think that in report builder I have to set the NLS_LANG environment variable .
    If anyone has done this is that true and if so how.
    Also the languages I want to use are the following.
    Armenian
    Cambodian
    Chinese
    Russian
    Tagalog
    Vietnamese
    How do I find the NLS_LANG environment variables for these.
    Where I am at now+
    I have to set the DEVELOPER NLS LANG. I see the NLS LANG in the registry and I guess I have to add the DEVELOPER NLS LANG.
    Now I am searching for syntax. If anyone knows the syntax for those languages please let me know and how do I set more than 1 at a time.
    Howard
    Edited by: csphard on Apr 14, 2010 5:17 PM
    Edited by: csphard on Apr 14, 2010 5:22 PM
    Edited by: csphard on Apr 15, 2010 9:02 AM

    Hello Howard,
    Check out the following link here you can find your desired NLS parameters.
    http://www.oracle.com/technology/tech/globalization/htdocs/nls_lang%20faq.htm
    And about the NLS_LANG for developer why you want to create for developer. Its is already there in REGISTRY. Just seaching in developer registry you can find there.
    how do I set more than 1 at a time.
    You can set only one NLS_LANG parameter at a time.
    -Ammad
    Edited by: Ammad Ahmed on Apr 15, 2010 8:52 PM

  • How do you set up a different ipad on same computer with different itunes library

    I am trying to update a clients ipad (who does not have access to internet at his residence) on my personal computer.  When I open up itunes with his apple ID, I continue to get my itunes library information.  I don't want to mix my information with his information.  How do you set up a different i pad/itunes on the same computer?  What I need to do is update the version of his i pad as his i pad is version 4.2.1.  Thank you

    Create a new Windows user account on the computer.
    (86398)

  • How to you set up a POP email account on iPhone 5S?

    How do you set up a POP emial account on iPhone 5S.  It only gives me an option for IMAP and I need POP
    THANKS

    Turn it on airplane mode.  Then set up you new account with all of your credentials.  Save, once it allows it.  Turn Airplane mode off, and then go back and select POP.

  • How do you set up iTunes 10.5 on a new computer?, How do you set up iTunes 10.5 on a new computer?

    I have a new computer  with Windows 7, Outlook and I use iTunes with an Apple iPhone 4 and a iPad. My devices have iOS5. How do you set up iTunes 10.5 on a new computer and sync these devices. I have already downloaded iTunes 10.5 on my computer. Also, I use MobileMe. Thanks for your help. LCP

    Thank you for your response. I have all of my files, etc. and am sitting here on the old computer. I just wasn't sure if I should simply save the iTunes program I am using or insall a new version.
    After I get iTunes onto my new computer do I authorize the new computer before I plug in my IPod or after?
    I'm sorry I didn't point out that I had all of my files available. For some reason, working with iTunes and my iPod make me nervous.
    Thanks again.
    Rustyglo

Maybe you are looking for