From: <ba...@us...> - 2008-04-04 19:02:27
|
Revision: 1696 http://obo.svn.sourceforge.net/obo/?rev=1696&view=rev Author: balhoff Date: 2008-04-04 12:02:32 -0700 (Fri, 04 Apr 2008) Log Message: ----------- Fixed problem with free text editor being too small in table. Modified Paths: -------------- phenote/trunk/src/java/phenote/gui/field/FreeTextField.java Modified: phenote/trunk/src/java/phenote/gui/field/FreeTextField.java =================================================================== --- phenote/trunk/src/java/phenote/gui/field/FreeTextField.java 2008-04-04 18:52:56 UTC (rev 1695) +++ phenote/trunk/src/java/phenote/gui/field/FreeTextField.java 2008-04-04 19:02:32 UTC (rev 1696) @@ -70,7 +70,17 @@ @Override public TableCellEditor getTableCellEditor() { - return new DefaultCellEditor(this.getTextField()); + return new DefaultCellEditor(this.getTextField()) { + @Override + public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { + final Component component = super.getTableCellEditorComponent(table, value, isSelected, row, column); + if (table != null) { + // JTable makes text editor too small, so we have to force it + table.setRowHeight(row, (int)(Math.ceil(component.getPreferredSize().getHeight()))); + } + return component; + } + }; } protected boolean hasInputVerifier() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |