coolscitist
coolscitist

Reputation: 3377

TableLayout of CodeName One

I am trying to build a really simple UI with CodeName One. I want a rectangular screen (to display image) and a button below it. I can't find anything like a panel for the rectangular screen, so I just put a label.

The hierarchy is shown below:

The components inside the container are: container:

Since vertical span of Label is 2, should not it occupy two rows? However, its visible height is same as 1 row. What is wrong?

What is the equivalent for panel (to show images) in this API? Is there a good tutorial for TableLayout managers? I am familiar with JGoodies, can I use JGoodies with this API?

Upvotes: 2

Views: 825

Answers (2)

MiguelMunoz
MiguelMunoz

Reputation: 4932

You can do this without specifying a vertical span of two. Specify a table with 2 rows, and it will expand the first row to fit the size of the image.

Upvotes: 0

Shai Almog
Shai Almog

Reputation: 52760

Gave an answer for this here

Pasting here for completeness:

That's a really simple layout, you shouldn't use table layout for this at all.

For the single column just set the parent to BorderLayout and place a Label for the white panel in the center and the button at the south.

For the two column layout you can again use border layout, in the center place a component with a two column/one row grid layout. Place two labels for the panels. Do the same for the south by placing a Container with a two column grid layout and two buttons.

Upvotes: 1

Related Questions