languageSelectorPanel.add(languageSelector);
languageSelector.addItemListener(this);
List<MyLocale> locales = new ArrayList<MyLocale>();
for (String loc : Main.getSupportedLanguages()) {
MyLocale current = new MyLocale(new Locale(loc));
locales.add(current);
}
Collections.sort(locales);
for (MyLocale element : locales) {
languageSelector.addItem(element);
}
JPanel dummy = new JPanel(new GridLayout(2,1));
englishTextArea.setEditable(false);
englishTextArea.setLineWrap(true);
englishTextArea.setWrapStyleWord(true);
translatedTextArea.setLineWrap(true);
translatedTextArea.setWrapStyleWord(true);
dummy.setPreferredSize(new Dimension(0, 300));
dummy.add(new JScrollPane(englishTextArea));
dummy.add(new JScrollPane(translatedTextArea));
JPanel rightPanel = new JPanel(new BorderLayout());
rightPanel.add(languageSelectorPanel, BorderLayout.NORTH);
rightPanel.add(new JScrollPane(table), BorderLayout.CENTER);
rightPanel.add(dummy, BorderLayout.SOUTH);
// splitpane
splitpane.setLeftComponent(new JScrollPane(tree));
splitpane.setRightComponent(rightPanel);
splitpane.setDividerSize(5);
splitpane.setDividerLocation(400);
// control panel to the south
bOk.addActionListener(this);
bExport.addActionListener(this);
bSave.addActionListener(this);
controlPanel.add(bExport);
controlPanel.add(bSave);
controlPanel.add(bOk);
// newLanguageSelector
String[] locs = Locale.getISOLanguages();
Arrays.sort(locs);
for (String loc : locs) {
newLanguageSelector.addItem( new MyLocale(new Locale(loc)) );
}
String i18n_newlang = I18N.translate("newLanguage");
languageSelectorPanel.add(new JLabel(" "+i18n_newlang));
languageSelectorPanel.add(newLanguageSelector);
languageSelectorPanel.add(bAdd);