Agustin Scalisi
Agustin Scalisi

Reputation: 551

Using two WebBrowsers on codename one (layout management)

I want to display two webbrowsers on one screen, the first show an URL and the second show a custom banner. I tried with a table layout to display two rows, and set the weight on 80% for the first and 20% for the second. But when I run the app only the first shows up, and cover 100% of the height

This is what I want: enter image description here

Is this possible?

Upvotes: 0

Views: 45

Answers (2)

tizbn
tizbn

Reputation: 1907

Please check this codes it should solve

protected void beforePage(Form f) {

    f.setScrollableY(false);
    TableLayout.Constraint c1 = new TableLayout.Constraint();
    c1.setHeightPercentage(80);
    c1.setWidthPercentage(100);
    TableLayout.Constraint c2 = new TableLayout.Constraint();
    c2.setHeightPercentage(20);
    c2.setWidthPercentage(100);

    WebBrowser browser = new WebBrowser();
    browser.setURL("http://www.facebook.com");

    WebBrowser browser2 = new WebBrowser();
      browser2.setURL("http://www.google.com");
    f.setLayout(new TableLayout(2, 1));
    f.addComponent(c1, browser);
    f.addComponent(c2, browser2);
}

Upvotes: 2

tizbn
tizbn

Reputation: 1907

yes its possible

  1. create tablelayout with column 1 and row 2
  2. add first webbrowser and set its height to 80 %
  3. and add second and set 20%

I hope it will help

Upvotes: 1

Related Questions