Continuous layout on JFrame resize?

hi,
on my machine (win2k) when you resize a JFrame with the mouse, the contents are not resized until you have released the drag. Is this a property of my java/OS settings or a limitation of Swing?
JSplitPane has a setContinuousLayout method which sounds like it does something similar?
thanks,
asjf

Component and Window listeners are not going to work since the window resize is not happening on the AWT thread.. So, you do need your own thread to monitor the size of the window, and invalidate/validate your window if the size changes. The following should work for you, coded as a method in a utility class so it can be easily reused by any JFrame:
     private static Map continuousLayoutWindows;
     * Sets the specified frame to do a continuous layout, so that if the user resizes the frame,
     * the components within the frame are resized as well.
     * @param frame JFrame
     public static void setContinuousLayout(final JFrame frame) {
          new Timer(100, new ActionListener() {
               public void actionPerformed(ActionEvent e) {
                    Dimension currentSize = frame.getSize();
                    if (continuousLayoutWindows == null) {
                         continuousLayoutWindows = new HashMap();
                    Dimension windowSize = (Dimension)continuousLayoutWindows.get(frame);
                    if (windowSize == null) {
                         windowSize = new Dimension();
                         continuousLayoutWindows.put(frame, windowSize);
                    if (!currentSize.equals(windowSize)) {
                         windowSize.width = currentSize.width;
                         windowSize.height = currentSize.height;
                         SwingUtilities.invokeLater(new Runnable() {
                              public void run() {
                                   frame.invalidate();
                                   frame.validate();
                                   frame.repaint();
          }).start();

Similar Messages

  • How to resize the components in a JFrame when the JFrame Resizes?

    Hi all,
    i have some problems with my app. I have set the JFrame resizable and that works fine for the JFrame but not for the components in the JFrame.
    So my question is how can i set the components in a JFrame to resize automatically when the JFrame resizes?
    Here are the important things from my code,...if you need more, just let me know, its my first post in a forum .
    Its a JFrame with a JTabbedPane and on the Tabs are Panels with buttons and Tables.
    Thank you in advance!
    public class MainMonitor extends JFrame {
    public MainMonitor() {
              super();
              initialize();
              setVisible(true);
         private void initialize() {
              this.setSize(1145, 785);
              this.setIconImage(Toolkit.getDefaultToolkit().getImage("Images/c.gif"));
              this.setContentPane(getJContentPane());
              this.setTitle("Company Manager");
              this.setResizable(true);
              this.setLocationRelativeTo(null);
         private JPanel getJContentPane() {
              if (jContentPane == null) {
                   jContentPane = new JPanel();
                   jContentPane.setLayout(null);
                   jContentPane.setOpaque(true);
                   jContentPane.add(getJTabbedPane(), null);
                   jContentPane.add(getJPanel11(), null);
              return jContentPane;
         private JTabbedPane getJTabbedPane() {
              if (jTabbedPane == null) {
                   jTabbedPane = new JTabbedPane();
                   jTabbedPane.setLocation(new Point(6, 69));
                   jTabbedPane.setSize(new Dimension(1120, 684));
                   jTabbedPane.addTab("P", null, getJPanel(), null);
                   jTabbedPane.addTab("K", null, getJPanel1(), null);
                   jTabbedPane.addTab("B", null, getJPanel2(), null);
              return jTabbedPane;
         

    Giasaste wrote:
    Thanks a lot, i didnt knew that the Layout Manager is a must.It's not a must, but it is the way to allow your app to be resized nicely and makes it much easier to maintain and enhance your program. Imagine creating a complex gui then later decide that you want another radiobutton and to remove a jlabel / jtextfield pair. with layout managers a chore becomes easy.

  • During the JFrame resize, unable to call mylogic.How to know JFrame rezing?

    {font:Arial}{size:10pt}Hi
    In my project i came across an issue. In that I had a JFrame (with FlowLayout) added with 24 JButtons (Its appearence will be similar as JToolbar). On this JFrame i called pack(). When i try to resize the JFrame, its componentResize() listener will not be called every time, instead it is calling only when its resizing complete.
    I am looking for a solution, that will rearrange JButtons (as specified Column/Row wise) during the JFrame resize. Can any body help me why componentResize() is not calling, during the resize. Tell me all alternate solutions. Pls help me.
    Waiting for your reply
    {size}{font}

    Can any body help me why componentResize() is not calling, during the resizeBecause its not very efficient to layout the frame every time you move the mouse 1 pixel. So by default this behaviour is turned off. I think you can turn in on by adding the following at the start of your program:
    Toolkit.getDefaultToolkit().setDynamicLayout(true);

  • Implementing JFrame Resizing Rules?

    Recently I've needed to enforce rules on a JFrame's dimensions (for example: preserving an aspect ratio).
    The obvious solution is to call setSize() from ComponentListener's componentResize() method. This is functional, but looking at the Java source, it's pretty inelegant. It actually starts a setSize() -> componentResized() -> setSize() loop that only terminates when setSize() is called with dimensions matching the current dimensions (see Component.reshape()). Also, its visually ugly because when maximized you can see the window snap back to the "fixed" size.
    It would seem that a more elegant way to add this functionality would be to have a method like "public Dimension checkDimensions(Dimension)" available for overriding.
    Does something like this already exist that I've missed?
    I've tried following the source, but I can't find the place where JFrame resizing is handled.

    The optimal solution would be to use a Look&Feel which doesn't have to use the OS window decorations, so the resize events are only generated in Java (not optimal in the fact that you don't get to have the OS frame decorations of course). Then you should be able to add your own RootPaneUI which simple doesn't allow resizing beyond a maximum size or auto resizing respecting an aspect ratio.
    See JFrame#isDefaultLookAndFeelDecorated and (for example) MetalRootPaneUI#MouseInputHandler. Perhaps there are thrid party look and feel where you can more easily replace a similar handler.

  • I downloaded Dreamweaver CC 2014.1, started using it but cannot find Show Fluid Grid Layout Guides button, Resize LI.link sizing handle and 'move up a Row' arrow. Where can I find them?

    I downloaded Dreamweaver CC 2014.1, started using it but cannot find Show Fluid Grid Layout Guides button, Resize LI.link sizing handle and 'move up a Row' arrow. Where can I find them?

    You have the latest version (CC 2014.1 or 2014.1.1) in which the interface condenses Design View with Live View buttons in normal layouts.  See screenshot.
    However, in FGLayouts, Live View is the only option which poses some editing problems and has been highly criticized.
    Is there any way to display the Design View in fluid grid pages?
    New Features in CC 2014.1 October Release
    http://helpx.adobe.com/dreamweaver/using/whats-new.html
    New Features in CC 2014.1.1 February Release
    https://helpx.adobe.com/dreamweaver/using/whats-new.html#Enhancements%20to%20Live%20View%2 0editing
    You can disable this restriction by adding an X to the FGLayout CSS.
        Dreamweaver Fluid Grid Properties
        dw-num-cols-mobile:      X 4;
        dw-num-cols-tablet:        8;
        dw-num-cols-desktop:    12;
        dw-gutter-percentage:    25;
    =====================================
    Having said that, it might just  be simpler to revert to an earlier version.  Log-in to Creative Cloud Desktop app.  Go to Filters & Versions > Previous Version.  See screenshot.
    Nancy O.

  • JFrame resize dynamically in response to content pane size changes

    Hi -
    I have a JFrame that uses CardLayout. The CardLayout panel content is of varied dimensions. it means the JComponents added to CardPanel will change size dynamically.
    Is it possible to have the JFrame resize dynamically in response to the content of the CardLayout panel changing?

    camickr wrote:
    No, the preferred size of a panel using a CardLayout is the preferred size of the largest component added to it.
    As a user I think it would be terrible to have the frame resize every time a turn a page to go to the next card. I have never seen this any any application.
    If you really need this functionality, then manage the panels yourself. Remove the existing Component before adding the next component and then do a frame.pack().My Application will be a JFrame.
    inside this JFrame i want to have three JPanels. according to some events and logic my GUI should switch to a given JPanel from those three panels. as i said the Jpanels sizes will change size on runtime depending on a automatic swing JPanel generation and i will have to add the new generated JPanel to parent JFrame with its new size
    any Ideas how to achive this ?

  • Resizing Image when JFrame resized?

    I have a JFrame with a JPanel added to the contentPane (BorderLayout.CENTER). In the JPanel is a JLabel (BorderLayout.CENTER) with an ImageIcon set to it. The image is a subimage of a larger image whose width is scaled to fit the current JLabel width (which is dictated by the JPanel width and finally dictated by the JFrame width).
    When the user resizes the JFrame, the image of the ImageIcon should be replaced with a new image which has been scaled to fit the new width and that reflects the new portion of the larger source image that is visible.
    The JFrame already has a ComponentListener added for retaining the current JFrame size and screen position, but calling my resizeDisplay() method from componentResized() does not seem to have the updated JLabel size. I have added a ComponentListener to the JLabel and called my resizeDisplay() method from componentResized() but it does not seem to have the updated JLabel size either.
    How can my application properly react to JFrame resizes so that the method is retrieving the new size values?
    Thanks,
    Robert Templeton

    Its always easier to solve a problem when sample code (not a complete program) is posted with the question.
    Maybe I don't understand the question, but when I run the following code the output reflects the size of the label after it has been resized. I'm using JDK1.3 on Window 98.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.text.*;
    public class TestLabel extends JFrame
         public TestLabel()
              JPanel panel = new JPanel();
              setContentPane( panel );
              panel.setPreferredSize( new Dimension( 200, 200 ) );
              panel.setLayout(new BorderLayout() );
              final JLabel myLabel = new JLabel( new ImageIcon("dukeWaveRed.gif"), JLabel.CENTER );
              panel.add( myLabel );
              myLabel.addComponentListener( new ComponentAdapter()
                   public void componentResized(ComponentEvent e)
                        System.out.println( myLabel.getSize() );
         public static void main(String[] args)
              TestLabel frame = new TestLabel();
              frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
              frame.pack();
              frame.setVisible(true);
    }

  • Jframe Resizing issue

    Hello, I have a very nice and pretty JFrame displaying on my screen right now, and I have a resize method attached to the resize event, and after I have resized my jframe the event is fired. All very well. However, I only get one resize event, and that only occurrs after I release the mouse from resizing. I would like to get continuous resizing events while I am in the process of adjusting the jframe size.
    If I start to resize, and I move my mouse two pixels, then I want a resize event. If I move it another 10 pixels then I want another resize event or whatever. I am not overely concerned about how many I get, but I definitely want to receive more than one event at the end.
    Any ideas?

    I stumbled across a reference that may help you. Take a look at http://java.sun.com/j2se/1.4.2/docs/guide/awt/AWTChanges.html which is the AWT Enhancements in the JavaTM 2 SDK, v1.4 page. It says, among other things,
    Dynamic Layout During Resize
    The bugtraq report that corresponds to this change is: 4077991.
    Previously, dynamic window resizing wasn't supported on all platforms. For example, on Windows NT, with solid resize on, resizing a window recalculated the layout only when the drag was finished. This has been fixed in this release with the addition of the new desktop property awt.dynamicLayoutSupported. When dynamic layout is enabled, a Container continually lays out its components as it resizes. If disabled, the layout will be validated after resizing has finished.
    API changes to java.awt.Toolkit.
    public void setDynamicLayout(boolean dynamic)
    protected boolean isDynamicLayoutSet()
    public boolean isDynamicLayoutActive()

  • Problem with JFrame resizing at runtime

    Hi All,
    I have a problem with resizing the JFrame at runtime. Even if i resize the JPanel. It is not affection on all the components over the frame. How can i solve that I am using AbsoluteLayout(jre1.6) and here i am going to provide you code snippet. My requirement is to resizt the form. If form is small in size then all the component should also be according tothe size of the form.
    public void initComponents(int size) {
    if(size >= 50) {
    x_co_or = 300;
    y_co_or = 300;
    } else if(size < 50) {
    x_co_or = 200;
    y_co_or = 200;
    jPanel1 = new javax.swing.JPanel();
    jButton1 = new javax.swing.JButton();
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
    jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
    jButton1.setText("jButton1");
    jPanel1.add(jButton1, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 40, 110, 40));
    getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, x_co_or, y_co_or));
    pack();
    Can anybody suggest any idea/solution.
    Any idea/solution are most welcome.
    Regards,
    Pradeep Dubey

    How can i solve that I am using AbsoluteLayout(jre1.6)
    and here i am going to provide you code snippet.no need for the snippet, you're using absolute positioning, which means you're responsible for location and size on every single change.
    start coding now, take about a week, or you could use a layout manager, take maybe, 5 minutes

  • Netbeans wont allow JFrame resize

    Hi Guys,
    I have just started using Netbeans 6.1 and am new to the netbeans environment for Java. I have been writing a simple GUI and it has been working fine until now. The GUI displays a JFrame which consists of a few panels, etc and some painted components. All was fine until today when I modified one of the panels indivigually when I went back to the main JFrame it had been reduced to a really small size as in a size of 0. Any attempts to rezise the JFrame or run the program results in the Netbeans error:
    java.lang.IllegalArgumentException: Invalid size
         at org.jdesktop.layout.GroupLayout.checkResizeType(GroupLayout.java:223)
         at org.jdesktop.layout.GroupLayout.checkSize(GroupLayout.java:208)
         at org.jdesktop.layout.GroupLayout.access$500(GroupLayout.java:85)
         at org.jdesktop.layout.GroupLayout$GapSpring.<init>(GroupLayout.java:2851)
         at org.jdesktop.layout.GroupLayout$SequentialGroup.add(GroupLayout.java:1588)
         at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.fillGroup(SwingLayoutBuilder.java:317)
         at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.composeGroup(SwingLayoutBuilder.java:232)
         at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.fillGroup(SwingLayoutBuilder.java:253)
         at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.composeGroup(SwingLayoutBuilder.java:232)
         at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.fillGroup(SwingLayoutBuilder.java:251)
         at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.composeGroup(SwingLayoutBuilder.java:232)
         at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.fillGroup(SwingLayoutBuilder.java:253)
         at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.composeGroup(SwingLayoutBuilder.java:232)
         at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.createLayout(SwingLayoutBuilder.java:174)
         at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.setupContainerLayout(SwingLayoutBuilder.java:107)
         at org.netbeans.modules.form.VisualReplicator.setupContainerLayout(VisualReplicator.java:791)
         at org.netbeans.modules.form.VisualReplicator.updateContainerLayout(VisualReplicator.java:324)
         at org.netbeans.modules.form.FormDesigner$FormListener.run(FormDesigner.java:2241)
         at org.netbeans.modules.form.FormDesigner$FormListener.processEvents(FormDesigner.java:2186)
         at org.netbeans.modules.form.FormDesigner$FormListener.formChanged(FormDesigner.java:2145)
         at org.netbeans.modules.form.FormModel.fireEvents(FormModel.java:1268)
         at org.netbeans.modules.form.FormModel.fireEventBatch(FormModel.java:1241)
         at org.netbeans.modules.form.FormModel.firePendingEvents(FormModel.java:1204)
         at org.netbeans.modules.form.FormModel.access$000(FormModel.java:62)
    [catch] at org.netbeans.modules.form.FormModel$2.run(FormModel.java:1184)
         at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
         at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
         at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
         at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
    This is probably a simple thing I have done wrong here but none of the properties seem to allow me to resize?
    any assistance would be much appreciated.
    cheers
    Tony

    Thanks mate, I reverterd to an older history when it was working and did the clean build seemed to fix the issue.
    Cheers

  • JFrame resize flicker using look&feel

    I just discovered JFrame's setDefaultLookAndFeelDecorated. Of course, it works great (refreshing to see it on vanilla windows!), but the frame flickers during mouse resizing. Every pixel the mouse moves, the frame is drawn gray then the previous frame's image is drawn over. Is there any way to stop this?
    And is there any way to do dynamic resizing? i.e. The window continuously revalidates&redraws itself while the user is resizing, and not just when the user stops resizing. At the least, is there a way to dynamically resize the border? Otherwise, a gray box (and the flicker) are the only things that shows until the user stops resizing.
    Specs: WinMe/JDK1.4.

    Run the following complete program and you should get the flicker problem when resizing it. Them dukes be still available! Tell me if you have any idea how to correct it, or how to dynamically resize the "guts" of the window. Thanks.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class JTestFrame extends JFrame {
         public static void main(String args[]) {
              new JTestFrame().show();
         private JMenuBar menuBar = new JMenuBar();
         public JTestFrame() {
              super("Java is cool");
              // Get the pane to add components to
              Container content = getContentPane();
              // Resize the frame
              Toolkit kit = getToolkit();
              Dimension wndSz = kit.getScreenSize();
              setBounds(wndSz.width/4, wndSz.height/4, wndSz.width/2, wndSz.height/2);
              // Make the frame use its look&feel for its border
              setUndecorated(true);
              getRootPane().setWindowDecorationStyle(JRootPane.FRAME);
              // Make a menu for no other purpose than making a menu
              JMenu fileMenu = new JMenu("File");
              fileMenu.setMnemonic(KeyEvent.VK_F);
              JMenuItem fileExitMenuItem = new JMenuItem("Exit");
              fileExitMenuItem.setMnemonic(KeyEvent.VK_X);
              fileExitMenuItem.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        System.exit(0);
              fileMenu.add(fileExitMenuItem);
              menuBar.add(fileMenu);
              JTextArea text = new JTextArea();
              getContentPane().add(new JScrollPane(text), BorderLayout.CENTER);
              setJMenuBar(menuBar);
              // Set the default close operation to exit the application
              setDefaultCloseOperation(EXIT_ON_CLOSE);
    }

  • JFrame Resize issue

    Allo all.
    I have a GUI that uses one JFrame and contains a Box layout of GridLayout and BoxLayout JPanels.
    I have set Max, Min and Pref sizes for all the JPanels, which works perfectly, the Frame wont get smaller than the minimum size, and it loads at the preffered size.
    However, expanding past the Max sizes leaves the components stranded top and center of the frame, with plenty of unwanted empty space.
    Setting the JFrames max, min and pref sizes completely ruins all the others, allowing resizing to 0,0 size and full screen.
    Any ideas? A quick look showed that I'd be able to extend JTable and do it that way some how, but I wasn't sure on the exact things I'd have to override.
    Java 1.5 , and I know a fair bit about Java.

    Extending the JTable class in order to solve layout problems is NOT THE WAY!!
    You'd be asking for more trouble than you already have. Instead, consider using a combination of a GridBagLayout and some RigidArea
    Box.createRigidArea(Dimension d] ,and perhaps some Glue- or Strut-components:
    Box.createHorizontalGlue()
    Box.createStrut(int width)
    [ /code]
    That should solve many layout issues....
    dealing with GUI's ==  puzzeling around with layoutmanagers and components                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • JFrame (resize -- disallow certain size)

    Hi,
    I have some code that disallows a JFrame from being resized smaller than a certain width and height. (see code below)
    But my problem is that this code allows the frame to be resized for a split second before it resizes it back to the defined minimum. My question is:
    Is there a way I can get the frame to NOT be resized below a certain width and height? Hence, when the user grabs the corner of the JFrame and tries to make the window smaller than the minimum defined width and height, the frame just stops moving (i.e. it becomes rigid and not elastic).
    The main reason for this question is that everything works great most of the time but since the frame is allowed to resize to a very small size for a split second some of my components get squished. I have set their min, max, and preferred size too, but it still squishes them and they are un-squishable after it happens. This would never occur if there was a way to do what I propose above.
    public final static void lockInMinSize(final JFrame frame, int width, int height){
       final int origX = width;
       final int origY = height;
       frame.addComponentListener(new ComponentAdapter() {
          public void componentResized(ComponentEvent event) {
             frame.setSize((frame.getWidth() < origX) ? origX : frame.getWidth(),
                 (frame.getHeight() < origY) ? origY : frame.getHeight());
    }

    The main reason for this question is that everything works great most
    of the time but since the frame is allowed to resize to a very small size
    for a split second some of my components get squished.As a rule, I place all of my panels into one large "content" JPanel. This content panel is then placed in a JScrollPane. It's the scroll pane that gets added to the JFrame's contentPane. The scroll policy (both horizontal and vertical) on the scrollPane is SCROLL_AS_NEEDED.
    After calling pack() on the frame, the frame comes up perfectly without visible scrollBars, since I've been diligent in giving each individual widget (JTextFields, JLists, etc.) a preferredSize.
    As the frame gets stretched, the fields adapt accordingly and still look fine. As the frame is shrunk, the fields squish only to their original positions. Anything more would cause the scrollBars kick in.
    So, I always size all of the individual fields, but never the panels or frames.
    Keep in mind that different layout managers rely on different sizes for the components. Since I use GridBag for the individual panels, I make sure to give each component a preferredSize
    I guess as an alternate, after construction is complete you could pack the frame, then call getSize to capture its "natural" size. Use this natural size for comparison in your componentResized method.
    Hope this helps. Good luck.

  • How do I get my Fluid Grid Layout page to resizes from portrait to landscape for iPhones?

    Starting in portrait on my iPhone 4, the fluid grid layout page does not resize when I turn to landscape.  After I refresh / resize to fit the page on landscape and then turn the iPhone to portrait, the page resizes just fine.  Everything seems to be working just fine on the desktop, ignoring IE.  Could it be my media query tags?
    If anyone knows a solution, it would be much appreciated.  Thanks.
    Here is my test page: http://www.bedroomandmore.com/1_b_fluidGrid.html
    Here are my media query tags (the first set of rules does not have the media query tag and becomes the default):
    @media only screen and (max-device-width: 480px) and (orientation : landscape) {
    @media only screen and (min-width: 481px) {
    @media only screen and (min-width: 769px) {
    Here is most of my media query CSS:
    @charset "UTF-8";
    /* Simple fluid media
       Note: Fluid media requires that you remove the media's height and width attributes from the HTML
       http://www.alistapart.com/articles/fluid-images/
    img, object, embed, video {
              max-width: 100%;
    /* IE 6 does not support max-width so default to width 100% */
    .ie6 img {
              width:100%;
    /* Mobile Layout: 480px and below.(smartphone portrait) */
    .gridContainer {
              width: 95.4184%;
              padding-left: 0.5907%;
              padding-right: 0.5907%;
    #header {
              clear: both;
              float: left;
              display: block;
              margin-left: 0%;
              width: 72%;
              max-height: 0%;
              display: -moz-box; /* Firefox */
              display: -webkit-box; /* Safari and Chrome */
              display: box;
              border: none;
              top: auto;
              padding-top: 0.25em;
    #menuHorizontal {
              clear: both;
              float: left;
              width: 118%;
              height:100%;
              margin-left: auto;
              position:relative;
              top:-1em;
              display: block;
    #slides {
              clear: both;
              float: left;
              margin-left: 0.1em;
              width: 119%;
              position: relative;
              top: -1em;
              display: block;
                        /*Slides container: Important: Use position:relative; with top:-1em; together to position div.
                                  Set the width of your slides container
                                  Set to    display: none     to prevent content flash*/
    .slides_container {
              clear: both;
              width: 100%;
              display: block;
                        /*Each slide: Important:
                                  Set the width of your slides
                                  If height not specified height will be set by the slide content
                                  Set to     display: block     for original setting
                                  slide_container is container size
                                  slides_container div set the size of the image inside--adjust to fit image in it so it is not cropped*/
    .slides_container div {
              clear: both;
              width: 69%;
              display: block;
              /* Mobile Layout: 480px. (smartphone landscape)
                                  Inherits styles from Mobile Layout 480px.
                                  Set to clear:none; to allow div to shift up
                                  Or set to clear:both; to take a whole row of the screen*/
    @media only screen and (max-device-width: 480px) and (orientation : landscape) {
    .gridContainer {
              width: 95.4184%;
              padding-left: 0.7907%;
              padding-right: 0.7907%;
    #header {
              clear:both;
              float: left;
              display: block;
              margin-left: auto;
              width:100%;
              display: -moz-box; /* Firefox */
              display: -webkit-box; /* Safari and Chrome */
              display: box;
              border: none;
    #menuHorizontal {
              clear:both;
              float: left;
              width: 110%;
              margin-left:auto;
              display: block;
    #slides {
              clear:both;
              float: left;
              margin-left: 0%;
              width: 68%;
              display: block;
                        /*Slides container: Important:
                                  Set the width of your slides container
                                  Set to    display: none     to prevent content flash*/
    .slides_container {
              clear:both;
              float: left;
              width: 100%;
              display: block;
                        /*Each slide: Important:
                                  Set the width of your slides
                                  If height not specified height will be set by the slide content
                                  Set to     display: block     for original setting*/
    .slides_container div {
              clear:both;
              width:69%;
              display: block;
                        /* Tablet Layout: 481px to 768px. Inherits styles from: Mobile Layout.
                                  Set to clear:none; to allow div to shift up
                                  Or set to clear:both; to take a whole row of the screen*/
    @media only screen and (min-width: 481px) {
    .gridContainer {
              width: 95.9456%;
              padding-left: 0.5271%;
              padding-right: 0.5271%;
    #header {
              clear:both;
              float: left;
              display: block;
              margin-left: auto;
              width: 100%;
              display: -moz-box; /* Firefox */
              display: -webkit-box; /* Safari and Chrome */
              display: box;
              border: none;
    #menuHorizontal {
              clear:both;
              float: left;
              margin-left:auto;
              display: block;
    #slides {
              clear:both;
              float: left;
              margin-left: 0%;
              width: 70%;
              display: block;
                        /*Slides container: Important:
                                  Set the width of your slides container
                                  Set to    display: none     to prevent content flash*/
    .slides_container {
              clear:both;
              float: left;
              width: 100%;
              display: block;
                        /*Each slide: Important:
                                  Set the width of your slides
                                  If height not specified height will be set by the slide content
                                  Set to     display: block     for original setting*/
    .slides_container div {
              width: 100%;
              display: block;

    I found the problem.  There is a bug in Safari for iPhone 4.  Use code to fix found at http://stackoverflow.com/a/6379407

  • JFrame resizing

    Hi,
    I have a JFrame, it displays on the right upper corner the icons minimize, maximize and exit.
    Minimize and Exit icons are working fine.
    I have the problem with the maximize button.
    The application I am writing allows to resize the JFrame. Thats fine!
    If I run the application, it has an initial size w=800, h=600
    If I click the maximize button, the JFrame fits to the window maximal size.
    But if I click the maximize button again, I want to have the initial size. This does not work.
    It keeps the maximal size.
    How can I switch
    - between maximal size and "initial" size
    or
    - between maximal size and last set size (so the size before Jframe was maximized)
    if I click the maximize button.
    Thanks
    A.

    Hi,
    I found the issue and fixed it.
    The issue is the following code.
    If I run the application, I call this function, it works fine.
    What it does is, it just horizontal center the window.
      public static void centerWindow(Window window) {
          Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
          int x = (int)((screen.width - window.getSize().width) / 2);
          int y = 0;
          window.setLocation(x, y);
      }If I run this function later on again after resizing the window, it causes the issue.
    So if I resize the window, I don't call this function anymore.
    Thanks
    A.

Maybe you are looking for

  • How can I get my iTunes window back?

    Help!! My iTunes main window has suddenly vanished & nothing I have tried will bring it back. I've tried everything I can think of. There is nothing in any of the menus that will bring it back. I have re-installed iTunes but that didn't help. The win

  • How do I download flash player to my Samsung note 10.1?

    My grandma purchased a samsung note 10.1 and she wants to play pogo on her device. She has the app from the play store but wants to playit using her browser. When she clicks the games to play them it says she doesnt have the latest flash p, ayer. Eve

  • Converting Varchar into Clob in Oracle 8i

    Hi All, Kindly tell me how can we convert a varchar variable into a Clob in Oracle 8i inside a stored procedure. I searched alot on the net, we have a To_Clob function available from 9i but doesn't exist in 8i. There was also talk about using dbms_lo

  • Material status in PO

    Experts, If I want to exlude / influence the material status (blocked for purchasing with error) check in PO type UB (Stock Transport Order), how to go about it? Is there a standard solution? This order type is used only for transfering stock within

  • For the Mac Experts Here...

    Ran across this on eBay... seems like a respectable company... 3GB RAM for $379.99!!! Too good to be true? http://cgi.ebay.com/3GB-DDR2-OPTIVAL-RAM-MEMORY-UPGRADE-APPLE-IMAC-INTEL_W0QQite mZ180103515598QQihZ008QQcategoryZ80037QQssPageNameZWDVWQQrdZ1Q