No scroll with components with 100% layout

I've imported a project depeloped in Flex Builder 2.0 into
Flex Builder 3.0. I have mxml components based con canvas whose
layout is 100% width and 100% heigth. When I open one of these
components in Flex Builder 3 there is no scroll bars in the design
view, so there's no way to work with the controls that not fit en
the view window. This doesn't hapend with Flex Builder 2.0.
Thank you

Speaking of this, the design area dropdown seems to disappear
randomly for no apparent reason. I've never actually seen it
disappear, so I don't know what's causing it, I just know that when
I open a file its there, then if I work on it for more than 5
minutes or something its gone, and I have to close the file and
reopen it to bring it back. I can't figure out why the dropdown
would just disappear, and its frustrating to have to close and
reopen a file everytime I want to resize the design area.

Similar Messages

  • How to center components horizontally in container with SpringLayout layout

    Hello,
    I've got a button and a text field in container with SpringLayout layout set. How can I center text field horizontally (buttong is the highest component)?
    I don't want use hacks like settings all heights manually.
    With regards,
    Pavel Krupets

    Sorry vertically!!!

  • I started with 100 pages in my photo book. Then reduced the number to 75 for finished project. When i click on "buy" it says I have some frames with no photos. But I've checked entire book

    I started a book with 100 pages, but reduced it to 75 by deleting some pages. When i completed the book & tried to buy it a box pops up saying I have some frames that need photos. I've checked the book over & over & cannot find any pages like that. How can I order my completed book?

    Look for pages that use photos for the background, even if you have other photos on the page. It'll look something like this in the layout pane:
    It would look like this in the PDF version:
    If you have a 1 photo per page, full page, you could have that option selected and not know it unless you looked at the layout pane like this example:
    OT

  • How do I make my Spry Accordion menu scroll *with* my webpage?

    Afternoon,
    I'm a newbie designer, just helping a friend build a website that will incorporate her blog and other stuff, but what I'm trying to do is set up my Spry Menu (set as a vertical accordion style) to scroll with the page.
    I want it to scroll within the confines on my div class="contentright"
    CSS for div class:
    .contentright {
        padding-top: 410px;
        float: left;
        width: 210px;
    HTML of same div class:
    <div class="contentright">
                                <div id="SpryAccordion1" class="Accordion" tabindex="0">
                                <div class="AccordionPanel">
                                    <div class="AccordionPanelTab tabTop">
    My webpage has a set width and is set to expand based on what I have in my main content area. I'm just not sure what to code and where to code it (in my HTML or in the CSS), to set my Spry to scroll. I'm assuming it's something with a .float functionality, maybe? I just need it to stay beneath my top padding so that it doesn't get overlapped by my main header logo that I had to set to position: absolute;
    Any ideas?

    Here is my HTML Coding
    <html>
        <head>
            <title>BetsyMarvin.com</title>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
            <meta name="description" content="" />
            <link rel="stylesheet" type="text/css" href="stylesheet.css" />
            <script type="text/javascript" src="SpryAssets/SpryAccordion.js"></script>
            <link href="SpryAssets/SpryAccordion.css" rel="stylesheet" type="text/css" />
    </head>
        <body>
            <div class="container">
                <div class="bannerArea">           
                    <div class="bannernav"><a href="#" >Privacy Policy</a>  |  <a href="mailto:[email protected]" >Contact Us</a>  |  <a href="#" >Site Map</a></div>
                    <span class="toplogo"></span>
                    <div class="toplogo"><a href="#"><img src="images/3 Words Buildup without BG.png" width="550" height="565" align="right" /></a></div>
                </div>
                <div class="contentArea">
                    <ul class="leftnavigation">
                        <li><a href="theme_02_design.html">Home Page</a></li>
                        <li><a href="blog_design.html">Blog</a></li>
                        <li><a href="lessons_design.html">Lessons</a></li>
                    </ul>
                    <div class="content">
                        <div class="contentleft">
                            <h1>Welcome to my Website</h1>
                            <img class="imageright" src="images/faith reason.jpg" border="0" />
                            <p>text</p>
                        </div>
                        <div class="contentright">
    <div id="SpryAccordion1" class="Accordion" tabindex="0">
                                <div class="AccordionPanel">
                                    <div class="AccordionPanelTab tabTop">
                                        <div class="accordion_340_tab">CONTACT ME</div>
                                    </div>
                                    <div class="AccordionPanelContent">
                                        <div class="acontent">
                                          <p> <a href "mailto:[email protected]"> Email</a></p>
                                          <p> <a href="http://www.cornerstonemi.org">Church Website</a></p>
                                          <p> <a href="http://www.facebook.com/betsy.marvin.32">Facebook</a></p>
                                          <p> <a href "www.twitter.com/betsymarvin"> Twitter</a></p>
                                        </div>
                                    </div>
                                </div>
                                <div class="AccordionPanel">
                                    <div class="AccordionPanelTab middleTab">
                                        <div class="accordion_340_tab">ABOUT ME</div>
                                    </div>
                                    <div class="AccordionPanelContent">
                                        <div class="acontent">
                                            <p>text</p>
                                        </div>
                                    </div>
                                </div>
                                <div class="AccordionPanel">
                                    <div class="AccordionPanelTab middleTab">
                                        <div class="accordion_340_tab">PASSIONS</div>
                                    </div>
                                    <div class="AccordionPanelContent">
                                        <div class="acontent">
                                            <img class ="imageright" src="images/love.jpg" width="130" height="64" />
                                                 <p>text</p>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="AccordionBottom"></div>
                        </div>
                        <div style="clear:both;"></div>
                    </div>
                    <div style="clear:both;"></div>
                </div>                           
                <div class="footerArea">
                    <div class="copyright">&copy; 2013 Betsymarvin.com | All rights reserved.</div>
                </div>       
            </div>
    <script type="text/javascript">
    <!--
    var SpryAccordion1 = new Spry.Widget.Accordion("SpryAccordion1", {useFixedPanelHeights:false, defaultPanel:2});
    //-->
            </script>
        </body>
    CSS Style Sheet
    body {
        margin: 0px;
        color: #666;
        font-size: 12px;
        font-family: Arial;
        font-family: Arial, Verdana, Univers;
        background-color: #545454;
        background-image: url(images/page_bkgd.jpg);
        background-repeat: repeat-x;
    h1 {
        color: #4F6179;
        font-size: 24px;
        font-weight: normal;
        margin: 3px 0px 25px 0px;
    h2 { color: #333333; font-size: 14px; font-weight: normal; margin: 0px 0px 15px 0px; }
    a          { color: #ba7007; }
    a:visited  { color: #ba7007; }
    a:hover    { color: black; }
    .container {
        width: 980px;
        margin-left: auto;
        margin-right: auto;
        background-image: url(images/content_bkgd_tile.jpg);
        background-repeat: repeat-y;
    /* BANNER AREA */
    .bannerArea {
        width: 980px;height: 145px;
        background-color: #4971a2;
        background-image: url(images/banner_bkgd.jpg);
        background-repeat: no-repeat;
    .bannernav {
        padding-top: 10px;
        padding-left: 10px;
        float: left;
        color: white;
        font-size: 10px;
        font-family: Arial, Helvetica, Verdana, sans-serif;
    .bannernav a {
        color: white;
        text-decoration: none;
    .bannernav a:visited {
        color: white;
    .bannernav a:hover {
        color: #ECBB7B;
    .toplogo {
        position: absolute;
        z-index: 100;
        padding-right: 0px;
        float: right; margin-left: 675px;
        padding-top: 10px;
    .content {
        padding-top: 20px;
        padding-bottom: 20px;
        padding-left: 25px;
        padding-right: 10px;
        background-image: url(images/content_bkgd.jpg);
        background-repeat: no-repeat;
        z-index: 100;
    /* LEFT NAVIGATION */
    .leftnavigation {
        width: 192px;
        margin: 70px 0px 0px 0px;
        padding-left: 8px;
        float: left;
        list-style-type: none;
    .leftnavigation a{
        margin-left: 0px;
        width: 156px;
        padding-left: 15px;
        padding-top: 5px;
        padding-right: 20px;
        padding-bottom: 5px;
        float: left;
        color: #CCA72F;
        font-size: 10px;
        font-weight: bold;
        font-family: Verdana, Arial, Helvetica, sans-serif;
        text-decoration: none;
        background-image: url(images/nav_normal.jpg);
        background-repeat: repeat-x;
        background-position: 0px 0px;
        border-bottom: 1px solid #999;
    .leftnavigation a:visited{
        color: #5C4C17;
    .leftnavigation a:hover{
        color: #ffffff;
        background-image: url(images/nav_down.jpg);
    /* CONTENT AREA */
    .contentleft {
        width: 400px;
        padding-left: 30px;
        padding-right: 20px;
        float: left;
    .contentright {
        padding-top: 410px;
        float: left;
        width: 210px;
    .imageright {
        margin-top: 10px;
        margin-left: 10px;
        float: right;   
    .imageleft {
        margin-right: 10px;
        float: left;
    /* FOOTER AREA */
    .footerArea {
        width: 980px;height: 88px;
        background-color: #cfcfcf;
        background-image: url(images/footer_bkgd.jpg);
        background-repeat: no-repeat;
    .copyright {
        border-top: solid;
        border-color: #737a90;
        border-width: 2px;
        margin-left: 240px;
        margin-right: 30px;
        padding-top: 12px;
        color: #666666;
        font-size: 10px;
        font-family: Verdana,Arial, Helvetica, sans-serif;
    CSS for the SPRY Accordion
    .Accordion {
        overflow: hidden;
        width: 255px;
    .AccordionPanel {
        margin: 0px;
        padding: 0px;
    .AccordionPanelTab {
        color: #CCA72F;
        margin: 0px;
        cursor: pointer;
        padding: 10px 30px 10px 20px;
        font-weight: bold;
        -moz-user-select: none;
        -khtml-user-select: none;
        background-repeat: no-repeat;
        background-image: url(../images/accordion_255_tab_normal.gif);
    .AccordionPanelContent {
        overflow: auto;
        margin: 0px 0px 0px 0px;
        padding: 0px 0px 0px 0px;
        background-image: url(../images/accordion_255_tile.gif);
    .AccordionPanelOpen .AccordionPanelTab {
        color: #d88a37;
        background-image: url(../images/accordion_255_tab_down.gif);
    .AccordionPanelTabHover {
        background-image: url(../images/accordion_255_tab_over.gif);
    .AccordionFocused .AccordionPanelTab {
        background-color: #000000;
    .AccordionFocused .AccordionPanelOpen .AccordionPanelTab {
        background-color: #000000;
    /* Custom AUC classes */
    #accordion_255 {
        background-image: url(../images/accordion_255_tile.gif);
        background-repeat: repeat-y;
        background-position: 0px 0px;
    .tabTop {
        background-position: 0px 0px;
        padding-top: 15px;
    .middleTab {
        background-position: 0px -151px;
    .accordion_255_tab {
        margin: 0px;
        font-weight: bold;
    .acontent {
        height:200px;
        width:220px;
        overflow: auto;
        padding: 5px 10px 10px 20px;
        useFixedPanelHeights = null;
    .AccordionBottom {
        width: 255px;
        height: 33px;
        background-repeat: no-repeat;
        background-position: 0px bottom;
        background-image: url(../images/accordion_255_bottom.gif);

  • How to create scroller with paging concept for mobile apps?

    Hi,
    I need a scroller control with Paging concept. When the user is in Landscape view, I want to load set of images as a Photo gallary.
    Each time the user swipes, he can go to the next image or the previous image.
    Each image is fully fit in the whole page. Means the user can see only 1 image at a time. He needs to swipe left or right to see the previous or next image.
    When he double clicks the image, he will be taken to another page.
    Can you give your ideas of how to implement this feature?
    FYI: I have seen samples of List with Horizontal layout. But it does not suit with my requirement.

    did you even find a solution.. ?

  • Tool bar dock problem with grid layout

    I have a tool bar with grid layout. When i dock it to vertical location(west or east) the buttons inside tool bar keep one row. I want to know how do i do to make the buttons arraged vertically like the tool bar with default layout when dock it at west or east position.

    I had started a custom layout manager for toolbars a few months ago that I found a little easier to use than the default BoxLayout. I just modified it to allow optionally matching the button sizes (width, height, or both), so you can get the same effect as GridLayout. Note that this one doesn't collapse the toolbar like the one in the other thread. Here's the source code as well as a simple test app to demonstrate how to use it. Hope it helps.
    //     TestApp.java
    //     Test application for ToolBarLayout
    // package ***;
    import java.awt.*;
    import javax.swing.*;
    public class TestApp extends JFrame
         /////////////////////// Main Method ///////////////////////
         public static void main(String[] args)
              try { UIManager.setLookAndFeel(
                   UIManager.getSystemLookAndFeelClassName()); }
              catch(Exception ex) { }     
              new TestApp();
         public TestApp()
              setTitle("ToolBarLayout Test");
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              setSize(400, 300);
              setLocationRelativeTo(null);
              JToolBar tbar = new JToolBar();
              ToolBarLayout layout = new ToolBarLayout(tbar);
              // Comment these two lines out one at a time to see
              // how they affect the toolbar's layout...
              layout.setMatchesComponentDepths(true);
              layout.setMatchesComponentLengths(true);
              tbar.setLayout(layout);
              tbar.add(new JButton("One"));
              tbar.add(new JButton("Two"));
              tbar.add(new JButton("Three"));
              tbar.addSeparator();
              tbar.add(new JButton("Musketeers"));
              Container c = getContentPane();
              c.setLayout(new BorderLayout());
              c.add(tbar, BorderLayout.NORTH);
              setVisible(true);
    //     ToolBarLayout.java
    //     A simple layout manager for JToolBars.  Optionally resizes buttons to
    //     equal width or height based on the maximum preferred width or height
    //     of all components.
    // package ***;
    import java.awt.*;
    import javax.swing.*;
    public class ToolBarLayout implements LayoutManager, SwingConstants
         private JToolBar     oToolBar = null;
         private boolean     oMatchDepth = false;
         private boolean     oMatchLength = false;
         private int          oGap = 0;
         public ToolBarLayout(JToolBar toolBar)
              oToolBar = toolBar;
         public ToolBarLayout(JToolBar toolBar, boolean matchDepths)
              oToolBar = toolBar;
              oMatchDepth = matchDepths;
         public ToolBarLayout(JToolBar toolBar,
                        boolean matchDepths,
                             boolean matchLengths)
              oToolBar = toolBar;
              oMatchDepth = matchDepths;
              oMatchLength = matchLengths;
         // If true, all buttons in the row will be sized to
         // the same height (assuming horizontal orientation)
         public void setMatchesComponentDepths(boolean match)
              oMatchDepth = match;
         // If true, all buttons in the row will be sized to
         // the same width (assuming horizontal orientation)
         public void setMatchesComponentLengths(boolean match)
              oMatchLength = match;
         public void setSpacing(int spacing)
              oGap = Math.max(0, spacing);
         public int getSpacing()
              return oGap;
         ////// LayoutManager implementation //////
         public void addLayoutComponent(String name, Component comp) { }
         public void removeLayoutComponent(Component comp) { }
         public Dimension minimumLayoutSize(Container parent)
              return preferredLayoutSize(parent);
         public Dimension preferredLayoutSize(Container parent)
              synchronized (parent.getTreeLock())
                   int orientation = getOrientation();
                   Component[] components = parent.getComponents();
                   int w = 0, h = 0;
                   int totalWidth = 0, totalHeight = 0;
                   int maxW = getMaxPrefWidth(components);
                   int maxH = getMaxPrefHeight(components);
                   Dimension ps = null;
                   if (orientation == HORIZONTAL)
                        for (int i=0; i < components.length; i++)
                             ps = components.getPreferredSize();
                             if (oMatchLength) w = maxW;
                             else w = ps.width;
                             if (oMatchDepth) h = maxH;
                             else h = ps.height;
                             if (components[i] instanceof JSeparator)
                                  w = ps.width;
                                  h = 0;
                             totalWidth += w;
                             if (i < components.length - 1)
                                       totalWidth += oGap;
                             totalHeight = Math.max(totalHeight, h);
                   else
                        for (int i=0; i < components.length; i++)
                             ps = components[i].getPreferredSize();
                             if (oMatchDepth) w = maxW;
                             else w = ps.width;
                             if (oMatchLength) h = maxH;
                             else h = ps.height;
                             if (components[i] instanceof JSeparator)
                                  w = 0;
                                  h = ps.height;
                             totalHeight += h;
                             if (i < components.length - 1)
                                       totalHeight += oGap;
                             totalWidth = Math.max(totalWidth, w);
                   Insets in = parent.getInsets();
                   totalWidth += in.left + in.right;
                   totalHeight += in.top + in.bottom;
                   return new Dimension(totalWidth, totalHeight);
         public void layoutContainer(Container parent)
              synchronized (parent.getTreeLock())
                   int orientation = getOrientation();
                   Component[] components = parent.getComponents();
                   Insets in = parent.getInsets();
                   int x = in.left, y = in.top;
                   int w = 0, h = 0, maxW = 0, maxH = 0;
                   Dimension ps = null;
                   if (orientation == HORIZONTAL)
                        maxW = getMaxPrefWidth(components);
                        maxH = Math.max( getMaxPrefHeight(components),
                             parent.getHeight() - in.top - in.bottom );
                        for (int i=0; i < components.length; i++)
                             ps = components[i].getPreferredSize();
                             if (oMatchLength) w = maxW;
                             else w = ps.width;
                             if (oMatchDepth) h = maxH;
                             else h = ps.height;
                             if (components[i] instanceof JSeparator)
                                  w = ps.width;
                                  h = maxH;
                             components[i].setBounds(
                                  x, y + (maxH-h)/2, w, h);
                             x += w + oGap;
                   else
                        maxH = getMaxPrefHeight(components);
                        maxW = Math.max( getMaxPrefWidth(components),
                             parent.getWidth() - in.left - in.right );
                        for (int i=0; i < components.length; i++)
                             ps = components[i].getPreferredSize();
                             if (oMatchDepth) w = maxW;
                             else w = ps.width;
                             if (oMatchLength) h = maxH;
                             else h = ps.height;
                             if (components[i] instanceof JSeparator)
                                  w = maxW;
                                  h = ps.height;
                             components[i].setBounds(
                                  x + (maxW-w)/2, y, w, h);
                             y += h + oGap;
         //// private methods ////
         private int getOrientation()
              if (oToolBar != null) return oToolBar.getOrientation();
              else return HORIZONTAL;
         private int getMaxPrefWidth(Component[] components)
              int maxWidth = 0;
              int componentWidth = 0;
              Dimension d = null;
              for (int i=0; i < components.length; i++)
                   d = components[i].getPreferredSize();
                   componentWidth = d.width;
                   if (components[i] instanceof JSeparator)
                        componentWidth = Math.min(d.width, d.height);
                   maxWidth = Math.max(maxWidth, componentWidth);
              return maxWidth;
         private int getMaxPrefHeight(Component[] components)
              int maxHeight = 0;
              int componentHeight = 0;
              Dimension d = null;
              for (int i=0; i < components.length; i++)
                   d = components[i].getPreferredSize();
                   componentHeight = d.height;
                   if (components[i] instanceof JSeparator)
                        componentHeight = Math.min(d.width, d.height);
                   else maxHeight = Math.max(maxHeight, componentHeight);
              return maxHeight;

  • How can I create banners with 100% height?

    I want the homepage to load with 100% height and there buttons that anchor to sections further down the website that I also want to be 100% height when scrolled to.

    3rd post on same question by same user :
    Re: how can I Create function with an  out Parameter
    how can I Create function with an  out Parameter

  • JTable: having first N columns not scroll with the rest of columns

    Hi All,
    I'm having trouble wording this properly (hence my inability to google for the solution)...
    What I am trying to do is:
    * Have a table with N number of columns (for example 100 columns).
    * The table is enclosed by scroll pane, so scrolling left and right will show different columns
    * I want first X number of columns (say 2 columns) to be always visible (i.e. they should not scroll with the rest of the columns)
    Is there a way to accomplish this with one JTable?
    Thanks and best regards,
    -Pavel

    I found the answer here:
    http://forum.java.sun.com/thread.jspa?threadID=665435&messageID=3951902
    Edited by: ptxyz on Jan 25, 2008 8:06 AM

  • Adobe Content Viewer crashes with particular layout

    Hello all,
    I have two layouts I've added to a folio, the first is a smooth-scrolling layout and the second is a snap-to-page layout. It works perfectly until I add the horizontal layouts of the second set.
    What I found most unusual is that everything works fine viewed vertically, but crashes on trying to view the horizontal layouts ( horizontal layouts uploaded by other team members in the same folio work fine somehow ). It works fine horizontally until I add the second set of layouts. The crashes happen only on the iPad, and works fine viewed on Content Viewer from the desktop. It's not just me either, other members are also having crash issues with my layouts..
    The horizontal layout is identical to the vertical layouts, and I'm not getting any sort of error messages, so I can't tell what's causing the folio to crash. What's going on?

    My folio still does not work. I've isolated the problem to one particular layout. When this article is in landscape layout, it causes the Content Viewer to crash. I have no MSO with the same name, and I've checked all the interactive objects and overlays to see what's causing this problem. It worked perfectly before the update to the new Content Viewer and before I updated the tools. The article also works fine in portrait view, and it has the exact same objects and interactivity. This is extremely frustrating, and I could be looking for hours to find what the problem is. Any help would be greatly appreciated.

  • **URGENT** - PRODUCTION ISSUE with Planning Layout

    Hi,
    we've a manual planning layout that uses both macros SAPAFTERDATAPUT and SAPBEFOREDATAGET with custom code developed in these 2 macros to switch data between "SEM-BPS 1" and "New" sheet.
    Layout has 11 characteristics in lead columns and around 40 keyfigures in data columns (dynamic).
    Using macros, we are formatting SEM-BPS 1 sheet to display all dynamic data coumns in a single page of New sheet.
    for this, our custom macro formats each row of SEM-BPS1 into 10 rows of New sheet by reducing 40 columns into 4 (columns is what matters for our users but not rows).
    We tried this for 40 rows of data. (means, 40 rows 40 columns). Our Custom macro formed 400 rows and 4 columns into New Sheet and even switched data between "SEM-BPS 1" and "New" sheet as per our macro coding. here, we can execute all planning functions. fine till this point
    Now, we have a problem when dealing with 100 rows. (means, 100 rows 40 columns). <b>Our custom macro had formed 1000 rows and 4 columns as expected with accurare data. </b>
    at this point, When we started running any planning function or even when we just click on check button (check button runs both SAP macros, I assume), <b>system is freezing up doing nothing. each time, we had to kill the process. when we looked into CPU usage, we can see that excel.exe process is using 99% of CPU.</b>
    Appreciate if any one can share experinces on this.
    <b><u>Note: </b></u>
    1. By disabling custom macros, we  executed 100 rows 40 columns w/o any issues.
    2. when executed custom macros outside of SAP for 1000 rows 4 columns, both macros took just 2 seconds to switch data between sheets.

    Hi there
    This is the option Jeff was referring to. I see it in my own RoboHelp version 10. As we aren't seeing it in your screen capture, I'm wondering if this was an option that was added via a service release you haven't installed.
    I do suppose another possibility would be that you are using RoboHelp for Word and perhaps that isn't an option with that application.
    Cheers... Rick

  • Custom ui component with default layout

    Hello,
    I am trying to develop custom swing components with default layout set.
    Both component class and its BeanInfo are written with NetBeans 6.1
    However, when trying to put this custom swing component into interface builder (matisse) of
    NetBeans 6.1, the default layout is always replaced with GroupLayout.
    Is there any way to correctly specify default layout manager used in a custom
    swing component?
    thanks a lot!

    Hi Jacek
    You can embed your custom component with IFrame element in WebDynpro view. IFrame element loads a content by URL which can be bound to controller's context. You can store your custom HTML content in MIME folder of the WebDynpro component. At runtime you can get the URL to the MIME content and initialize the IFrame with the URL.
    However, IFrame element is being reloaded by WebDynpro framework too often during each request/response cycle. This is a disadvantage of the solution.
    BR, Siarhei

  • Remove component from JFrame with absolute layout

    I have a JFrame and JPanel inside the JFrame with absolute layout. I wanted to have a button when clicked the JPanel will be removed. I called jFrame.remove(jPanel);
    jFrame.repaint();
    jFrame.validate();
    I can't call jFrame.revalidate(), since JFrame doesn't provide revalidate() method. I try everything, but I can't get that JPanel removed. Could somebody help me please. Oh I tried jPanel.setBounds( 0,0,0,0); and the jPanel is disappeared, but I don't think this is the right solution. Is my problem with the absolute layout?
    Thanks

    public class MainGame
         public void game()
              GridBagLayout gridBagLayout = new GridBagLayout();
              GridBagConstraints constraints = new GridBagConstraints();
              final MainFrame mainFrame = new MainFrame();
              mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              mainFrame.setLayout( gridBagLayout );
              JPanel mainGamePanel = new JPanel();
              mainGamePanel.setLayout( new BorderLayout() );
              mainGamePanel.setBackground( Color.black );
              final Room mainEntrance = new Room( "at the main entrance of the deep forest" );
              mainEntrance.setBackground( Color.white );
              mainEntrance.setLayout( null );
              mainEntrance.setExit( Direction.UP, null );
              mainGamePanel.add( mainEntrance, BorderLayout.CENTER );
    //          c.fill = GridBagConstraints.CENTER;
              constraints.ipady = 800;      //make this component tall
              constraints.ipadx = 600;
              constraints.anchor = GridBagConstraints.WEST;
              constraints.gridx = 0;
              constraints.gridy = 0;
              gridBagLayout.setConstraints( mainGamePanel, constraints );
              mainFrame.getContentPane().add( mainGamePanel );
              thePlayer = new Human( "Cloud" , "The player" );
              thePlayer.setMaximumWeight( MAXIMUM_WEIGHT );
              thePlayer.setImage( Constants.CHARACTER_FRONT );
              thePlayer.setBounds(0 , 0, 40, 30 );
              thePlayer.setBorder( BorderFactory.createLineBorder( Color.black ) );
              mainEntrance.add( thePlayer );
              apple = new EdibleItem( "apple" , "Give more 10 HP" );
              apple.setHp( 100 );
              apple.setImage( Constants.APPLE );
              apple.setBounds( 40, 0, 40, 30 );
              apple.setBorder( BorderFactory.createLineBorder( Color.black ) );
              mainEntrance.add( apple );
              thePlayer.addItem( apple );
              apple1 = new JPanelWithBackground();
              apple1.setImage( Constants.APPLE );
              apple1.setBounds( 80, 60, 40, 30 );
              apple1.setBorder( BorderFactory.createLineBorder( Color.black ) );
              mainEntrance.add( apple1 );
    //          final Room forest = new Room( "at the main entrance of the deep forest" );
    //          forest.setBounds( 0, 0, 800, 600 );
    //          forest.setBackground( Color.white );
    //          forest.setLayout( null );
    //          forest.setExit( Direction.UP, null );
    //          // Add to list
              listOfItems.add( apple );
              listOfItems.add( apple1 );
               * Main Control Panel to control character and actions
              JPanel controlPanel = new JPanel();
              controlPanel.setBackground( Color.black );
              controlPanel.setBounds( 1000, 0, 600, 600 );
              controlPanel.setLayout( new GridLayout( 0, 1 ) );
              JButton eatButton = new JButton( "EAT" );
              // Set this button to setFocusable(false) to prevent this button being focused
              // So the focus will stay at JFrame
              eatButton.setFocusable( false );
              eatButton.addActionListener( new ActionListener()
                   @Override
                   public void actionPerformed(ActionEvent e)
                        JPanelWithBackground currentObject = mainGame.getFacingObject();
                        if( currentObject instanceof EdibleItem )
                             //EdibleItem apple = ( EdibleItem )currentObject;
              controlPanel.add( eatButton );
              JButton attackButton = new JButton( "ATTACK" );
              attackButton.setFocusable( false );
              attackButton.addActionListener( new ActionListener()
                   @Override
                   public void actionPerformed(ActionEvent e)
                        System.out.println( "Remove" );
                        mainFrame.getContentPane().remove( mainEntrance );
                        mainEntrance.setBounds( 0,0,0,0);
    //                    mainFrame.add( forest );
                        mainFrame.validate();
                        mainFrame.repaint();
              controlPanel.add( attackButton );
              mainFrame.setVisible( true );
              mainFrame.requestFocusInWindow();
    }I know that my code is a mess, because it is connected with many classes and the quality of the format is not very good. But I will refactor it later when I solved the problem.
    The problem is I have a JPanel with a character and an apple in it. I could not use any other layout, I have to use absolute layout, because I the user can control the character but arrow keys. And the character moves in pixels.
    Here what I wanted to do.
    final Room mainEntrance = new Room( "at the main entrance of the deep forest" );
              mainEntrance.setBackground( Color.white );
              mainEntrance.setLayout( null );
              mainEntrance.setExit( Direction.UP, null );Room extends JPanel, I wanted to delete this panel when I clicked this button
              JButton attackButton = new JButton( "ATTACK" );
              attackButton.setFocusable( false );
              attackButton.addActionListener( new ActionListener()
                   @Override
                   public void actionPerformed(ActionEvent e)
                        System.out.println( "Remove" );
                        mainFrame.getContentPane().remove( mainEntrance );
                        mainEntrance.setBounds( 0,0,0,0);
    //                    mainFrame.add( forest );
                        mainFrame.validate();
                        mainFrame.repaint();
              controlPanel.add( attackButton );Like I said before, I tried validate, repaint and setBounds to all 0s. Nothing happened with the Room class. How do I delete that Room.
    Thank you so much.

  • Lightroom imports with 100 clarity

    Hello people,
    i have the strange problem that lightroom imports always with 100 clarity. There is definitely something wrong with my presets, just don't know how to change that. Thanks for any suggestions, tobfl

    If you apply a preset during the import process, that preset will be applied to all images that are imported. Another way to apply a preset to all images would be to have multiple images highlighted in the develop module and have auto-sync enabled.
    The first thing I would suggest that you try is to reset the clarity on one of those newly imported images, changing nothing else. Then, save new camera defaults. Then I would check in your import dialog to make sure you haven't chosen a preset to be applied during the import process. Next, take a test image and import it.

  • Scrolling with mouse on pages create black and white lines,

    When scrolling with mouse, periodically the whole screen turns into black and white lines. Sometimes whole page, sometimes just pictures/side ads. If you continue to scroll it does go away but then you need to scroll back to where the lines started, its hard to explain, i have taken 1 photo of the problem but will take more photos as i can, i really enjoy how Firefox runs on my computer, it has always been the best browser for my needs. I did recently buy a new desktop, but it did it then also, so i removed it and tried running explorer and Google and i just don't like them, so i am hoping we can get this fixed.

    Try to disable hardware acceleration in Firefox.
    *Tools > Options > Advanced > General > Browsing: "Use hardware acceleration when available"
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    *https://hacks.mozilla.org/2010/09/hardware-acceleration/
    If there is a problem with scrolling on web pages then try to disable smooth scrolling.
    *Tools > Options > Advanced > General: Browsing: "Use smooth scrolling"

  • How do I create a automatic second page with different layout settings?

    Hi there,
    I want to create a business letter template with a different second page. I already managed to create a different layout on page nr two, but
    whenever I write a letter with this template and I reach the end of page one, pages creates a thrid page in between my page nr one and nr two with a mixture of the layout of template page nr two and the footer of page nr one.
    I want pages to take my template page nr two (with different header and footer) as second page instead of creating one itself.
    If I don't need a second page - because my letter is to short - I should not have to delete a second page. It simply should not be there...
    Thanks for Help!
    G4's and 12" PB   Mac OS X (10.4.6)  

    Hello Stefan,
    you achieve this with a little trick. Create your letter and set the layout for the first and the second page by inserting a placeholder text. This placeholder text should fill the first page and the top of the second page, so both pages are build in one section. When the entire letter is layouted well, select the placeholder text and than save the letter as a template.
    Now every time you open this template, you only have to insert the main text (replace the placeholder text with real content), and the second page disappears until the main text overflows the borders of the first page. Than you will get the second page again with the layout you have created for it.
    I hope this will work for you like it works fine for me.

Maybe you are looking for