I have a subclass of javax.swing.table.AbstractTableModel that defines table column headers like this: protected String[] columnNames = new String[] { "Column1", "Column2};. How do I localize the columnNames from a resource bundle? I want to read the column headers from a .properties file instead on hard-coding them in my code. Is there a better way of doing this?
I have a subclass of javax.swing.table.AbstractTableModel that defines table column headers like this: protected
Share
Easiest way is to modify your assignment of columnNames:
Where AppResources (or AppResources_en, AppResources_fr_FR etc.) is a class that extends ResourceBundle and contains a key called “headings” which returns a comma separated list of headings.