translation-tool: abstract the table to a separate class
git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@664 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
parent
d8a0c8fe45
commit
11a5489fb7
2 changed files with 15 additions and 2 deletions
14
src/micropolisj/util/TranslatedStringsTable.java
Normal file
14
src/micropolisj/util/TranslatedStringsTable.java
Normal file
|
@ -0,0 +1,14 @@
|
|||
package micropolisj.util;
|
||||
|
||||
import java.awt.*;
|
||||
import javax.swing.*;
|
||||
import javax.swing.table.*;
|
||||
|
||||
public class TranslatedStringsTable extends JTable
|
||||
{
|
||||
public TranslatedStringsTable(TableModel tm)
|
||||
{
|
||||
super(tm);
|
||||
setDefaultEditor(String.class, new DefaultCellEditor(new JTextField()));
|
||||
}
|
||||
}
|
|
@ -30,8 +30,7 @@ public class TranslationTool extends JFrame
|
|||
System.exit(1);
|
||||
}
|
||||
|
||||
stringsTable = new JTable(stringsModel);
|
||||
stringsTable.setDefaultEditor(String.class, new DefaultCellEditor(new JTextField()));
|
||||
stringsTable = new TranslatedStringsTable(stringsModel);
|
||||
JScrollPane scrollPane = new JScrollPane(stringsTable);
|
||||
stringsTable.setFillsViewportHeight(true);
|
||||
getContentPane().add(scrollPane, BorderLayout.CENTER);
|
||||
|
|
Reference in a new issue