Shikhar13 / codenameone

Automatically exported from code.google.com/p/codenameone
0 stars 0 forks source link

BorderLayout.EAST does not place content right aligned on containing form #286

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In the example below, the "EAST label" label is NOT placed aligned with the 
right side of the form, but instead somewhere in the middle. 

Sorry if this bug report is wrong, I'm a surprised if this kind of basic 
functionality doesn't work, but I couldn't find anything wrong in my example. I 
also checked the Developer's Guide but it says nothing about the BorderLayout. 

What steps will reproduce the problem?
1. Run the code below in the simulator

What is the expected output? What do you see instead?
The "EAST label" should be right aligned on the form. Instead it is placed to 
the right of the "WEST label" (see attached file for screenshot). 

What version of the product are you using? On what operating system?
Trunk revision 372. Windows 7 32 bit, Netbeans 7.2 with plugin 1.0.16. Using 
the Simulator. 

Please provide any additional information below.

Container cont = new Container(new BorderLayout());
cont.addComponent(BorderLayout.WEST, new Label("WEST label"));
cont.addComponent(BorderLayout.EAST, new Label("EAST label"));
Form form = new Form();
form.addComponent(cont);
form.show();

Original issue reported on code.google.com by ch.hj...@gmail.com on 4 Aug 2012 at 10:36

Attachments:

GoogleCodeExporter commented 9 years ago
Please use images in the future not doc files.
You can also use the discussion group for questions.
EAST is east within cont. 
However, the form uses flow layout by default which gives cont the preferred 
size rather than the full screen. Set the form layout to something like Box Y 
which will give decedents full width.  

Original comment by shai.almog on 4 Aug 2012 at 1:04