Can someone tell me the function of a box. You can't put anything inside the box. Well I have not been able to anyway, so that might be just me.

asked 25 Feb '14, 01:44

Raymond's gravatar image

Raymond
24321
accept rate: 0%


Hi Raymond,

You can't put anything inside the box in tableLayout and borderLayout due the structure of these layouts. In these layouts, it's not possible to overlay two or more cells.

The only layout which meets your request is xyLayout since it allows you to overlay multiple cells. The example below shows how to put 2 textFields in the box:

  <xyLayout>
    <cell height="100" width="200" x="10" y="10">
      <box/>
    </cell>
    <cell x="20" y="30" height="20" width="100">
      <textField/>
    </cell>
    <cell x="20" y="60" height="20" width="100">
      <textField/>
    </cell>
  </xyLayout>

If you don't want to use xyLayout, you can always simulate the box appearance in tableLayout and borderLayout by implementing a panel for each box and its content. Just set the borderType attribute of the panel as "TitledBorder" (and set borderTitle if necessary) to simulate the box appearance.

<panel borderType="TitledBorder">
  <tableLayout>
    <row height="10"/>
    <row height="20">
      <cell>
        <textField/>
      </cell>
    </row>
    <row height="10"/>
    <row height="20">
      <cell>
        <textField/>
      </cell>
    </row>
  </tableLayout>
</panel>

Hope this helps,
Ibrahim

link

answered 25 Feb '14, 15:48

Ibrahim%20Sandalli's gravatar image

Ibrahim Sand... ♦♦
1.5k5
accept rate: 25%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×7

Asked: 25 Feb '14, 01:44

Seen: 759 times

Last updated: 25 Feb '14, 15:48


© Copyright Gerger 2017