Ah, yes, the ScrollPane "view" needs to be set with the contents (and
not by using "add"):

scrollPane.setView(label /* or whatever */);

 

There can only be one component which is the "view" of the ScrollPane,
so normally the contents is packaged inside another container.

 

The BXMLSerializer dynamically creates Java objects, but doesn't
generate Java source code.  There isn't such a serializer that I know
of.  

 

~Roger Whitcomb

 

From: Schwartz, Cynthia L [mailto:[email protected]] 
Sent: Tuesday, March 19, 2013 10:36 PM
To: [email protected]
Subject: RE: how to add something (anything?) to a ScrollPane (using
java code)

 

Roger,

 

I tried putting it in a BoxPane, FillPane, and also calling
scrollPane.setSize(300,300) with no new results. Also centered the
label, etc.  Should I be using

.add to put the content, i.e. label in the ScrollPane?

 

       FillPane fillPane = new FillPane();

        

        ScrollPane scrollPane = new
ScrollPane(ScrollPane.ScrollBarPolicy.ALWAYS,ScrollPane.ScrollBarPolicy.
ALWAYS);

        scrollPane.setSize(300,300);

        Label label = new Label("test");

        try {

        label.setStyles("{horizontalAlignment:'center',
verticalAlignment:'center'}");

        } catch (SerializationException e) {}

        

        scrollPane.add(label);

        fillPane.add(scrollPane);

     

  

       window.setContent(fillPane);

        window.setMaximized(true);

        window.open(display);

 

About the other problem -- Yes I figured out that I cannot put a Window
within a Window and then read it somewhere on the Pivot site.  You also
indicated this by having me put the menubar is the first row when the
DockingWindow was a Window.   I ended up making the MainWindow  a Frame
with a Menubar and wrapping the docking window in a TablePane instead of
a Window.  Now I am trying to add content into the panes of the docking
window.  Is there a serializer the convert bxml to java because that
would help. 

 

Thanks,
Cynthia

 

From: Roger L. Whitcomb [mailto:[email protected]] 
Sent: Tuesday, March 19, 2013 8:01 PM
To: [email protected]
Subject: RE: how to add something (anything?) to a ScrollPane (using
java code)

 

Hi Cynthia,

You would need to set a size for the ScrollPane, or else put it inside
(say) a FillPane that will set its size automatically.

 

How are you doing with your earlier question?  Did you get things
working?

 

~Roger Whitcomb

Reply via email to