Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-1817

JTable ColumnModel not set in SwingBuilder

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0
    • 1.1-beta-1
    • None
    • None
    • Patch

    Description

      When using the tableModel() element in the swingBuilder and using the groovy.model.DefaultTableModel the ColumnModel on the JTable is not being set by the SwingBuilder. The end result is that things suhc as the preferred size of the columna re not being reflected into the column model being used by the JTable.

      For example:
      <code>
      import groovy.swing.SwingBuilder

      import javax.swing.WindowConstants as WC

      data = [\
      [nick:'MrG', full:'Guillaume Laforge'],\
      [nick:'jez', full:'Jeremy Rayner']\
      ]

      swing = new SwingBuilder()
      frame = swing.frame(title:'Table Demo', defaultCloseOperation:WC.EXIT_ON_CLOSE, size:[300,150] ) {
      scrollPane {
      table() {
      tableModel( list:data )

      { propertyColumn(header:'NickName', propertyName:'nick', preferredWidth:100 ) propertyColumn(header:'Full Name', propertyName:'full', preferredWidth:200 ) }

      }
      }
      }

      frame.show();
      </code>

      Attachments

        1. groovy-1817.txt
          2 kB
          Daniel Ferrin

        Activity

          People

            shemnon Daniel Ferrin
            shemnon Daniel Ferrin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: