Application frame layout basics

Below is my attempt at organizing the components of my application. Basically I have 2 areas that I call leftBox and graphicsBox. The graphicsBox contains a JPanel object called graphics. The graphics panel is surrownded by 8 buttons to pan the display as needed.
As you can see, I put everything in boxes, but I don't get the behavior I want. I would like to accomplish the following:
1. To be able to specify the size of the graphics panel initially, so that it uses the biggest area available.
2. When resizing the window, I would like to see only the graphics area change size.
I hope you can advise me on what types of layout managers to use so I can improve my application.
Thanks for your help.
import java.awt.*;
import javax.swing.*;
public class FrameComponents {
  public static void main(String[] args) {
    JFrame frame = new TestFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.show();
class TestFrame extends JFrame {
  public TestFrame() {
    setTitle("Frame Test");
    setSize(400, 350);
    Container contentPane = getContentPane();
    Box bigBox = Box.createHorizontalBox();
    Box leftBox = Box.createVerticalBox();
    JTextArea textArea = new JTextArea("Hello there on the left...");
    JButton closeButton = new JButton("Close");
    leftBox.add(textArea);
    leftBox.add(closeButton);
    bigBox.add(leftBox);
    Box graphicsBox = Box.createVerticalBox();
    Box topRow = Box.createHorizontalBox();
    JButton nwbutton = new JButton("nw");
    JButton nnbutton = new JButton("nn");
    JButton nebutton = new JButton("ne");
    topRow.add(nwbutton);
    topRow.add(nnbutton);
    topRow.add(nebutton);
    graphicsBox.add(topRow);
    Box centerRow = Box.createHorizontalBox();
    JButton wwbutton = new JButton("ww");
    JButton eebutton = new JButton("ee");
    JPanel graphics = new JPanel();
    graphics.setBackground(Color.white);
    centerRow.add(wwbutton);
    centerRow.add(graphics);
    centerRow.add(eebutton);
    graphicsBox.add(centerRow);
    Box bottomRow = Box.createHorizontalBox();
    JButton swbutton = new JButton("sw");
    JButton ssbutton = new JButton("ss");
    JButton sebutton = new JButton("se");
    bottomRow.add(swbutton);
    bottomRow.add(ssbutton);
    bottomRow.add(sebutton);
    graphicsBox.add(bottomRow);
    bigBox.add(graphicsBox);
    contentPane.add(bigBox);
    setVisible(true);
}

Read this section from the Swing tutorial on [url http://java.sun.com/docs/books/tutorial/uiswing/layout/visual.html]Using Layout Managers.
Specifically, check out the BorderLayout. Size is suggested by using setPreferredSize(...).

Similar Messages

  • CS5 Mac, Application Frame, and shelled custom UIs

    Just discovered that in CS5/5.1, when Photoshop has "Application Frame" turned on and an image is opened not in tabbed mode (ie. is floating), when we launch our custom UI is shows up BEHIND the image. Our custom UI is actually run a separate process, so we basically block PS until we return. While blocked, any other application run from the Finder (unless it is dialog-based) will show up BEHIND the image in Photoshop.
    Anyone know of a way to work around this? Can I let PS idle in an event loop of some kind? Funny how OS X doesn't have the concept of application-specific window priorities.

    Anyone? This seems to happen if anything blocks Photoshop for whatever reason. Do we need to send some events to Photoshop to tell it to clean up its global window priority while we do our thing?

  • Adobe recommends: CSS page layout basics

    Over the next week, we are going to be publicizing some high-value content  from adobe.com and other community sites. We have been tracking what's   been most important to our users, and feel that getting this content out to the larger community will go a long way toward helping people tackle some of their most pressing challenges.
    Continuing on our quest for great layout tips, our next recommendation comes from yours truly:
    CSS page layout basics
    This article takes you through the A-Z of what makes up a basic CSS layout. It also shows you how to use some of the CSS layouts that come packaged with Dreamweaver.
    Give it a spin and let us know what you think!
    Previous recommendation threads:
    Use Dreamweaver CS 5.5 to package your web application for iOS and Android devices
    Customizing a Spry Menu Bar widget
    Spry Menu Bar resources
    Layout 101

    Although I love sending newbies to tutorials, I am sometimes stuck with a quandary especially when I see the word basics.
    To me, a basic layout does not require any more than
    <!DOCTYPE HTML>
    <html>
    <head>
      <meta charset="utf-8">
      <title>Untitled Document</title>
      <style>
              body {width: 960px; margin: auto;}
              #header {height: 85px; background: #060;}
              #nav {height: 35px; background: #000;}
              #aside {height: 400px; width: 180px; background: #999; float: left;}
              #article {margin-left: 200px;}
              #footer {height: 35px; background: #000; clear: both;}
         </style>
    </head>
    <body>
      <div id="header"></div>
      <div id="nav"></div>
      <div id="aside"></div>
      <div id="article"></div>
      <div id="footer"></div>
    </body>
    </html>
    In the above I have used fixed heights. That is because I have not placed any content into the div elements, but still wanted to show the outcome.
    When the basic layout has been settled on, we can start with our niceties like resetting styles, padding for the content etc. I have noticed that David Powers has written an article (which I have not as yet read) on Modernizr wich will help as a good starting point.
    The main thing to keep in mind is to keep it simple.
    Gramps
    Oops! Sorry! the Modernizr article goes way beyond the basics. Please only tackle this if you are brave enough. The reason I thought that it may be a good starting point is beacause I have been using HTML5Boilerplate (which includes Modernizr) for quite some time now.
    Message was edited by: altruistic gramps

  • Application frame not working plus other issues Illustrator CC Mac

    Running Illustrator CC on a Mac. I'm missing the maximize, minimize, and close buttons in the top left corner. I have an "Ai" symbol in the top left, which I thought was only on the PC version? All my tools disappear when I turn on application frame. I deleted the preferences file, no luck. When I hold down command shift option during startup of Illustrator it says "error loading plugins"....Please help!

    I am having this same issue. Should I just uninstall and reinstall? Or do they need to give me special instructions?

  • Application frame not working

    Maybe i'm misunderstanding, but with the application frame checked i thought that when i moved my main image window either by the corner resizing method or dragging the title bar, the entire contents, including the palettes were supposed to move.  However, on my mac, snow leopard, when the move the image around, the palettes stay where they are.  They don't' move with everything else, just like when application frame is turned off.  Please help.   Thanks.

    I am having this same issue. Should I just uninstall and reinstall? Or do they need to give me special instructions?

  • FAQ: UI - How can I change the color theme, size of the text, or turn off the application frame?

    CHANGING THE INTERFACE COLOR SCHEME:
    The Photoshop CS6 default interface is dark, but if you prefer the lighter interface you are used to from earlier versions,
    you can change it back in the appearance area. There are 4 default color themes.
    Mac          Photoshop > Preferences > Interface
    Windows   Edit > Preferences > Interface
    CONFIGURING LARGER FONTS:
    For those who need larger fonts, you can also change the UI Font Size down in the type area.
    Be sure to restart Photoshop to see the changes.
    TURNING OFF THE APPLICATION FRAME
    CS6 opens now by default in "Application Frame". You can go Window>Application Frame in the main meu and uncheck this

    Select the title / text and then click on the "i" (inspector). A colored pin wheel shows up after you click on the square box directly below the font settings inside the inspector window. Then simply drag the dot to the color you want. Like this:
    click here
    Message was edited by: SDMacuser

  • One application with Multiple schemas- common application frame work

    Hi All,
    I am trying setup a common application frame work in apex. Please help me.
    How to achieve this.
    Creation of one application attached to different schemas at run time. So that my application maintaince is going to be easy instated of creating copies of same application.
    More details:
    1. I have one application with 100 pages pointing to a schema dev_common in one workspace APP_COMMON. I have 50 schemas with same structure of dev_common schema with different set of data ( because of large amount of data).
    So I want to create one application attached to different schemas.
    2. And another thing is I have 100 users, the user can work on 1 or multiple schemas ( I mean same application with different schemas attached)
    Any help much appreciated.
    Thanks,

    Thank you for the reply.
    >> b) I think you have to give access rights for the dev_common and app_common to all users.
    Dev_common schema is a kind of placeholder. I have 50 schemas same as dev_common because of different business requirements but the front end is same for all 50 schemas. How can we create one application used for 50 schemas instead of creating 50 applications and 50 workspaces.
    Please help me.

  • How to contain all windows in Application Frame cs5 MAC

    Hello,
    This is my last resort to hopefully find a solotion to my problem.
    Ive recently switched from PC to MAC, and since the switch I have had some trouble with photoshop (apparently its not the same?)
    Now please bear with mem I have trouble explaining this properly hehe
    Okay...
    When I have two photos open in cs5 in tabs, If i drag one out of the tab and then click on the photo still tabbed the one that isnt tabbed disappears! Its floating in behind photoshop over my desktop. If I minimize photoshop, I can see the file floating there?
    Is there any way to keep all files (windows) contained within the application frame itself, so they no longer "float" behind the photoshop application frame??
    I hope this makes enough sense!
    I never had trouble with windows floating outside of photoshop when I was using PC...

    Hi,
    Do you have the application frame in photoshop cs5 turned on or off?
    Window>Appliction Frame
    A check mark beside the word application frame means it's on.

  • Adobe Photoshop CC 'Window-Application Frame' setting

    So I've never been an adopter of the whole adobe application frame; I like the openness and abiltiy to click my desktop behind the image I'm working on. I know how to turn it off, but how do I KEEP it off? Every time I close and reopen photoshop it's back on, and I saved my workspace to see if that would result in any changes but it didn't. Didn't ever run into this issue on CS6.

    Well I will say I had a TON of problems when I updated to CC. I went in and erased every ounce I could find of my adobe software from CS5 and 6 using both the uninstalls, cleaner, and manual removal, then reinstalled my OS and then installed CC. I did fix quite a few bugs by logging into my root account and setting my user account as read/write on everything in the Library, User, and Applications folder.
    Might just have to do a full restart on my system. Copy, delete, act like I'm transferring to a new computer.
    I've done several intensive command line checks on the drive in single user mode and everything checks out fine.
    Sorry I failed to state earlier im on the most recent edition of Mountain Lion, though both posts are relevant.

  • Is there a keyboard shortcut to close the Application Frame in CS6 Mac? Mousing to menus or click on

    Nothing works to close this window except mouse/clicking... I don't like it being in the background when I'm working in other apps.

    I'm not a Mac user, so I don't have a way to check this myself, but what's the behavior when you do disable it via the setting, then open an image?  Does the image just open a window exactly the size of the displayed image?  I assume this is different than what you're looking to see.  Maybe a couple of screenshots would help others reading this thread (e.g., Adobe folks) to understand how you'd prefer it to work.
    I think the intent is to make the default Photoshop behavior the same on a Mac as on a PC, and on a PC there's no way to eliminate the Application Frame at all.
    -Noel

  • Application Frame Issue

    The Application Frame window opens up too tall on both my monitors.  I cannot resize it nor access any of the tools at the bottom.  Is there any other way to resize it except by grabbing it with the cursor and dragging the edge, since obviously I cannot do that when it sits offscreen?

    Does switching to another Workspace have any effect?
    If you are on Mac what happens if you hit the green button top left?
    If all else fails you could try 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.

  • BI application frame -----------how to use it?

    hi,
      anybody help me that how to use BI application frame ui element in webdynpro java what are the properties i should fill,
    Thanks,
    santhosh.

    Hi Santhosh,
                I think the following link will lead you to solve your problem.
    https://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/clientserver/uielib/bi/api/package-summary.html
    Regards
    Harish

  • Application Frame Stuck below screen bottom in PS CS6

    After connecting to a flat screen TV for a presentation yesterday, the Photoshop CS6 application frame I was working on suddenly had the bottom edge below the screen on my MacBook Pro. I can uncheck Application Frame in Window to free up the project, but with it checked I cannot find a way to reach the bottom of the frame and the scale input control. Also cannot reach the lower layers in the layer menu. What gives?
    Thanks in advance for your help!
    D

    Thanks Curt, I did that before as well. No dice. I even rebooted everything. But since my first post I was able to reach the bottom of the frame and resize it to fit by selecting "Scaled" and "More Space" in System Preferences / Displays. This reduced everything enough so that the PS Frame bottom was above the bottom edge of my display. I resized it and then reverted back to "Best for Retina display." Problem solved.
    Cheers,
    D

  • Application Frame problem

    Hi:
    Of late when I use the application frame it is sized so large (not by me) that you cannot see the information at the bottom on the tabbed image and the Panels section.  I have tried to resize it but it extends so low that the cursor cannot reach the control.  I have already tried uninstalling and installing and that worked and I reset it to my desired size but when I came back the next day the problem was back.  I figured finally that it must be a Preference and I restarted and allowed for resetting and again this worked.
    My question is does anyone know what the actual plist is for the Application frame so that I can trash that directly?
    Herman R.

    PECourtejoie wrote:
    The + jellibean is the maximize button (for those that might not see the image)
    Which is also useful to know for those of us who use the Graphite theme (System Preferences > Appearance) and thus see no color and no "jelly beans" anywhere in our Macintosh user interface:

  • Can't resize Photoshop application frame

    I have iMac OS X 10.6.8 and have been running Photoshop CS5 for two years. Recently the photoshop application frame extended below the bottom of my screen so I can't grab the lower corner and manually resize it. Also, I can't change the screen mode in the drop down menu. I think messed up the settings when I resized the type on different applications as a test for a friend of mine. Is there a way to reset the display in both photoshop and in the apple drop down menu that will enable the photoshop application frame to fit back on the screen?

    Try hitting the "Green Dot" up in the top left of the Application Frame window. Then hitting it again.
    Likewise, you can try turning off the application frame feature and turning it back on under the "Window" menu.

Maybe you are looking for

  • How do I get Safari to open on a specific desktop by default?

    I have recently upgraded to Mavericks, I have a TV display connected to my iMac which is not always switched on at the same time as my iMac (I use it for streaming onto a big screen). I have noticed that by default the Safari Application opens in 'De

  • OC4J 10.0.3 Standalone LDAP / OID JAZN Authentication

    I have tried to setup OID based authentication on OC4J 10.0.3, but I can't get it working. Here is my log output: ==> log/oc4j.err.log <== 04/10/27 16:21:28 java.lang.NoClassDefFoundError: oracle/ldap/util/Guid 04/10/27 16:21:28 at oracle.security.ja

  • Component TV Wiring

    Is it possible to hook up a component cable from the 6416 DVR to a non-HDTV that has a component input on Video Input 1?  My DVD works fine with a component cable to the TV through my A/V unit.  If I connect from the 6416 with a component cable I get

  • Webutil - Instalation OK but , nothing display

    Hi sir.. My instalation of webutil is ok, but in th browser nothing display are stopped !! In my Java Console : JInitiator: Versión 1.3.1.9 Usar versión JRE 1.3.1.9 Java HotSpot(TM) Client VM Directorio local del usuario = C:\Documents and Settings\h

  • Get a printer error when saving a message as a pdf

    i restored the HD on my MacBook pro. NOW IF I TRY TO SAVE A MESSAGE AS A PDF IN THE PRINT DIALOGUE BOX I GET A MESSAGE THAT READS 'PRINTER ERROR. HOWEVER, MY PRINTER IS WORKING FINE.