Java - FlowPanel - Use a parent variable from a child
<pre><code>public class PageIndex extends FlowPanel {
    private PageHeader header;
    private PageCenter center;
    private PageFooter footer;
    public PageIndex() {
        this.header=new PageHeader();
        this.add(header);

        this.center=new PageCenter();
        this.add(center);

        this.footer=new PageFooter();
        this.add(footer);
   }
}

public class PageCenter extends FlowPanel {
    private PageMenu menu;
    private PageContent content;

    public PageCenter() {
       this.setStyle("center");

       this.menu=new PageMenu(content);
       this.add(menu);

       this.content=new PageContent();
       this.add(content);
   }
}

public class PageMenu extends FlowPanel {
    private PageContent content;
    private PageMenuLogin login;
    private PageMenuSearch search;
    private PageMenuOffers offers;
    private PageMenuStudents students;
    private PageMenuShopping shopping;
    private PageMenuEvents events;
    public PageMenu (PageContent content) {
        this.content=content;
        this.login=new PageMenuLogin();
        this.add(login);
        this.search=new PageMenuSearch();
        this.add(search);
        this.offers=new PageMenuOffers();
        this.add(offers);
        this.students=new PageMenuStudents();
        this.add(students);
        this.shopping=new PageMenuShopping();
        this.add(shopping);
        this.events=new PageMenuEvents();
        this.add(events);

        // IF I WRITE THIS I GET AN org.apache.jasper.JasperException: java.lang.NullPointerException
        this.content.daghine();
    }
}
</code></pre>

<p>I need to manage the content instance, but is not visible. Sorry, Im a bit rusty :)</p>
