You don't need the border layout. This is only a tip for the simple usage 
in a form.
Using the same strings make it hard for me to read the code and screenshot 
without trying it. 

If you think there's a bug you can file an issue. Unfortunately you 
probably understand we have a deep issue pipeline and it takes us a long 
while to evaluate everything.

On Friday, August 21, 2020 at 11:23:10 AM UTC+3 P5music wrote:

> I use BL surrounding a BC because I think I have understood that it 
> "encourages" the BC to spread. And other BLs are surrounding. 
> It is a trial/error method but now I am stuck. 
> I wanted to show you a possible issue: indeed the layout is inverted, what 
> is CENTER is at the top and what is NORTH is at the bottom. This could be 
> of interest in general if a bug is discovered.
> Back to my layout, text is not important, the BC do not spread, this is 
> the problem. If you will test the code, you can also remove something 
> redundant, or tweak it, so I have the solution, otherwise it is a bug, this 
> is of interest for you anyway, I think, solving this would shed light on 
> the subject..
> Thanks in advance
>
> Il giorno venerdì 21 agosto 2020 alle 06:44:38 UTC+2 Shai Almog ha scritto:
>
>> You can nest a border layout in a table cell although I'm not sure what 
>> the benefit would be but this is OK.
>>
>> You lost me a bit with all the level of nesting all over the place, 
>> reading the code I have no idea how it should look by now and since 
>> everything is conveniently named "Multiline text" my brain is stack 
>> overflowing..
>>
>> I suggest opening this in Component Inspector and looking at the sizes of 
>> each component in the hierarchy. Where they were placed and why.
>> On Thursday, August 20, 2020 at 12:07:48 PM UTC+3 P5music wrote:
>>
>>> You have to see the attached image, that corresponds to the code below: 
>>> you can see an inverted layout, indeed the instructions text is at the 
>>> bottom, while it is added NORTH to the form. And what you see at the top is 
>>> added CENTER. I was trying some changes and stumbled into this. Am I wrong? 
>>> Is this an issue?
>>>
>>> As to my real code, I am not using CENTER constraint in the TL. Just 
>>> each cell is a BL container with the BC inside, I used this scheme for 
>>> another layout and it worked.
>>> If you mean that the TL should not be CENTER in a BL, also if I put it 
>>> in a BoxLayout.y the layout does not work.
>>> 100% height is not harmful I think because there is just one row, 
>>> however I removed it.
>>> the form was set not scrollable.
>>> But still the BC do not take the space.
>>>
>>> Here's the code that I talked about. If I am not wrong this could be an 
>>> issue.
>>> Anyway can you suggest some tweaks using it as a starting point, said 
>>> that the intended layout is that the two BCs are at the bottom and they are 
>>> expanded to show full text?
>>> Thanks in advance
>>>
>>> private void createForm()
>>>     {
>>>         Command backCommand=new Command("Back") {
>>>             @Override
>>>             public void actionPerformed(ActionEvent evt) {
>>>                 parentForm.showBack();
>>>             }
>>>         };
>>>
>>>         this.setScrollable(false);
>>>         getToolbar().setBackCommand(backCommand);
>>>
>>>         setTitle(formTitle);
>>>         Container mainContainer=new Container();
>>>         
>>>         mainContainer.setLayout(BoxLayout.y());
>>>        
>>>         TableLayout tl=new TableLayout(1,2);
>>> Container tableContainer=new Container();
>>> tableContainer.setLayout(tl);
>>>
>>>
>>>         Container centerContainerLeft=new Container(new BorderLayout());
>>>         Container centerContainerRight=new Container(new BorderLayout());
>>>
>>>         SpanLabel textArea=new SpanLabel();
>>>        
>>>         textArea.setText("Multiline text\nMultiline text\nMultiline 
>>> text\nMultiline text\n");
>>> add(BorderLayout.NORTH,textArea);
>>>
>>>
>>>         BrowserComponent textAreaLeft=new BrowserComponent();
>>>        
>>>         textAreaLeft.setPage("<HTML><BODY><DIV 
>>> style='overflow-x:scroll;'>"+"Multiline Text</BR>Multiline 
>>> Text</BR>Multiline Text</BR>Multiline Text</BR></DIV><BODY></HTML>","");
>>> centerContainerLeft.add(BorderLayout.CENTER,textAreaLeft);
>>>
>>>         BrowserComponent textAreaRight=new BrowserComponent();
>>>        
>>>         textAreaRight.setPage("<HTML><BODY><DIV 
>>> style='overflow-x:scroll;'>"+"Multiline Text</BR>Multiline 
>>> Text</BR>Multiline Text</BR>Multiline Text</BR></DIV><BODY></HTML>","");
>>>        
>>>         centerContainerRight.add(BorderLayout.CENTER,textAreaRight);
>>>
>>>
>>> tableContainer.add(tl.createConstraint().widthPercentage(50),centerContainerLeft).
>>>         
>>> add(tl.createConstraint().widthPercentage(50),centerContainerRight);
>>> mainContainer.add(tableContainer);
>>> add(BorderLayout.CENTER,mainContainer); //same if I add tl directly
>>>     }
>>>
>>>
>>> Il giorno giovedì 20 agosto 2020 alle 03:44:47 UTC+2 Shai Almog ha 
>>> scritto:
>>>
>>>> Don't use center constraint in the table layout. It will break 
>>>> everything. Leave it as the default. 
>>>> Height should never be 100 as all the heights together should come up 
>>>> to 100 (it's in percent).
>>>> Don't use span, it makes column calculation hard and spanning 2000 
>>>> columns is probably not what you're trying to do.
>>>>
>>>> Also make sure you invoked form.setScrollable(false).
>>>>
>>>>
>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/6aaba2ee-b3fa-43df-aa85-20375806d1c9n%40googlegroups.com.

Reply via email to