lwuit
  1. lwuit
  2. LWUIT-474

Table horizontal spanning rendered wrong while using setWidthPercentage

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      I've been trying to render table with some horizontal spanning. This is how it should look like:

      http://i.stack.imgur.com/CJ0lg.jpg

      In LWUIT 1.4 everything worked correctly. Since 1.5 the table looks like:

      http://i.stack.imgur.com/EBHBG.jpg

      My implementation:

      DefaultTableModel model = new DefaultTableModel(new String[]

      {"", "", "", ""}

      , new String[][]{

      {"Header", null, null, null}

      ,

      {"1", "2", "3", "4"},
      {"1", "2", "3", "4"}

      ,
      {"String", null, "String", null}});

      Table tab = new Table(model, false) {

      protected Component createCell(Object value, final int row, final int column, boolean editable)

      { Component c = super.createCell(value, row, column, editable); c.setFocusable(false); return c; }

      protected TableLayout.Constraint createCellConstraint(java.lang.Object value, int row, int column) {
      TableLayout.Constraint tlay = super.createCellConstraint(value, row, column);
      if (row == 0 && column == 0)

      { tlay.setHorizontalSpan(4); tlay.setHorizontalAlign(Table.CENTER); }

      else if (row == 3)) {
      if (column == 0)

      { tlay.setHorizontalSpan(2); tlay.setWidthPercentage(50); } else if (column == 2) { tlay.setHorizontalSpan(2); tlay.setWidthPercentage(50); }

      } else if (row != 0)

      { tlay.setWidthPercentage(25); }

      return tlay;
      }

      };

        Activity

        Hide
        hajhet added a comment -

        It works better without setWidthPercentage(50). Table structure is well rendered, but width percentages are inexact.
        http://stackoverflow.com/questions/7071417/lwuit-1-5-table-horizontal-spanning-problem

        Show
        hajhet added a comment - It works better without setWidthPercentage(50). Table structure is well rendered, but width percentages are inexact. http://stackoverflow.com/questions/7071417/lwuit-1-5-table-horizontal-spanning-problem

          People

          • Assignee:
            Unassigned
            Reporter:
            hajhet
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: