BUI BScrollPane

Is there any detailed documentation on this widget? I looked at the javadoc documentation but it didn't really help me figure out what I need to do to get this working. Basically what I'm trying to do is have a window for editing a list of properties, represented by a label and text field pair for each property. The list is of arbitrary length, so I would like to be able to have them all contained in a scrollable container (BScrollPane?). Currently I have a window with a BScrollPane instance added to it and a BContainer as the child passed to the scroll pane's constructor. The scroll pane displays correctly and the contained components for each property clip as expected, but the scrollbar owned by the scroll pane doesn't do anything, when I would expect it to scroll so that I could view the clipped components.



Can someone point me in the right direction?

i didn't really use BScrollPane. but if all you want to do is to display a list, why not use BScrollingList? you'll just have to implement the createComponent() method to return a container which holds the label and the text field.

i'll also look into the BScrollPane thing.

here's a quick and silly example of using the ScrollPane



import java.io.InputStream;
import java.io.InputStreamReader;

import com.jme.app.SimpleGame;
import com.jme.input.MouseInput;
import com.jme.renderer.ColorRGBA;
import com.jmex.bui.BContainer;
import com.jmex.bui.BLabel;
import com.jmex.bui.BScrollPane;
import com.jmex.bui.BStyleSheet;
import com.jmex.bui.BTextField;
import com.jmex.bui.BWindow;
import com.jmex.bui.PolledRootNode;
import com.jmex.bui.layout.BorderLayout;
import com.jmex.bui.layout.TableLayout;

public class TestBScrollPane extends SimpleGame {
  @Override
  protected void simpleInitGame() {
    display.getRenderer().setBackgroundColor(ColorRGBA.orange);
    MouseInput.get().setCursorVisible(true);
   
    PolledRootNode buiRoot = new PolledRootNode(timer, input);
   
    BStyleSheet style = null;
    try {
        InputStream stin = getClass().getClassLoader().
            getResourceAsStream("rsrc/style.bss");
        style = new BStyleSheet(new InputStreamReader(stin),
                                new BStyleSheet.DefaultResourceProvider());
    } catch (Exception e) {
        e.printStackTrace(System.err);
        System.exit(-1);
    }
   
    BWindow  window = new BWindow(style, new BorderLayout());
    TableLayout tableLayout = new TableLayout(2, 3, 0);
    BContainer container = new BContainer(tableLayout);
    container.add(new BLabel("Bananas"));
    container.add(new BTextField("3"));
    container.add(new BLabel("Monkeys"));
    container.add(new BTextField("ook"));
    container.add(new BLabel("Llamas"));
    container.add(new BTextField("huh?"));
    container.add(new BLabel("Frogs"));
    container.add(new BTextField("burp"));
    container.add(new BLabel("Carrots"));
    container.add(new BTextField("many"));
    container.add(new BLabel("Elephants"));
    container.add(new BTextField("none"));
    container.add(new BLabel("Apples"));
    container.add(new BTextField("10"));
    container.add(new BLabel("Someotherstuff"));
    container.add(new BTextField("0"));
   
    BScrollPane scrollPane = new BScrollPane(container, true, true);
    window.add(scrollPane, BorderLayout.CENTER);
    window.setSize(200, 200);
    window.center();
    buiRoot.addWindow(window);
    rootNode.attachChild(buiRoot);
  }

  public static void main(String[] args) {
    TestBScrollPane app = new TestBScrollPane();
    app.start();
  }
}