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?
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
}