Java GUI Help

Discussion in 'Mac Programming' started by Awesomeness, Mar 22, 2009.

  1. macrumors member

    Joined:
    Feb 12, 2009
    #1
    Ok, I have a GUI in AWT and Swing, and I set the size of my JFrame, but... It includes the title bar. How do I set the size of the CONTENT of my JFrame?

    Thanks beforehand,
    --Awesomeness

    And yes, I have figured out the size of the mac title bar. However, I want my app to be cross platform, and that means that it differs between OSes.
     
  2. macrumors 604

    iShater

    Joined:
    Aug 13, 2002
    Location:
    Chicagoland
    #2
    What exactly are you putting in the frame? what layout manager are you using?
     
  3. thread starter macrumors member

    Joined:
    Feb 12, 2009
    #3
    None

    None. I am using paint() to make graphics in a window. I have a pane inside it, but even when I set its size frame.pack() doesn't do what I want it to do.
     
  4. macrumors 604

    iShater

    Joined:
    Aug 13, 2002
    Location:
    Chicagoland
    #4
    I'm having a hard time understanding what you are trying to do, and what you are seeing instead. Care to give more details?
     
  5. thread starter macrumors member

    Joined:
    Feb 12, 2009
    #5
    Okay, I'm generating a box in a window using paint() and it's not coming out where I want it to be because the window, including the title bar, is in my case is 400 pixels tall, but the content of the window is only 377 pixels tall because the title bar takes up 23 of those pixels. I could make it 423 pixels tall instead, but that wouldn't work on PCs because their title bar is much taller. I need to make the content 400 pixels tall.
     
  6. thread starter macrumors member

    Joined:
    Feb 12, 2009
    #6
    Nevermind. I found the solution here:
    http://www.acm.org/crossroads/xrds13-3/minueto.html
     
  7. macrumors 604

    iShater

    Joined:
    Aug 13, 2002
    Location:
    Chicagoland
    #7
    Aaaaah... now I get it, and thanks for posting the link for future programmers. :D
     

Share This Page