I have created one JTabbedPane with 3 tabs.
When i switching to different tabs stateChang does not responds to click.
when i put debug mark to my code in side public void stateChanged(ChangeEvent e) { }, i see no effect after click.
What can be the reason and how can i fix it?
public class TabbedPanChangeListener implements ChangeListener {
ConfigToolScannersPanel panel;
List<String> artikels = GenericsUtil.makeList();
public TabbedPanChangeListener(ConfigToolScannersPanel configToolScannersPanel) {
this.panel = configToolScannersPanel;
}
public void stateChanged(ChangeEvent e) {
WebTabbedPane sourceTabbedPane = (WebTabbedPane) e.getSource();
int index = sourceTabbedPane.getSelectedIndex();
String titel = sourceTabbedPane.getTitleAt(index);
File dirconfig = new File("C:\\tmp\\config");
File dirPictures = new File("C:\\tmp\\Pictures");
File diraxi = new File("C:\\tmp\\");
File artikels = new File("C:\\tmp\\artikels.csv");
if (dirconfig.exists()) {
if (titel.equalsIgnoreCase("ftp")) {
panel.updateUI();
} else if (titel.equalsIgnoreCase("Picture")) {
setSelectedFileToNull();
BorderLayout layout = (BorderLayout) panel.pictureTabPanel.getLayout();
panel.pictureTabPanel.remove(layout.getLayoutComponent(BorderLayout.WEST));
panel.pictureTabPanel.add(FileList.getGui(dirPictures.listFiles(), true, panel), BorderLayout.WEST);
panel.pictureTabPanel.remove(layout.getLayoutComponent(BorderLayout.NORTH));
panel.pictureTabPanel.add(FileList.getGui(diraxi.listFiles(), false, panel), BorderLayout.NORTH);
panel.pictureTabPanel.remove(layout.getLayoutComponent(BorderLayout.CENTER));
// *** Add and remove from tool bar ***
visibaleInvisibale(false);
panel.btnDelete.setVisible(true);
panel.btnDelete.setAction(new DeletePictureAction(panel));
panel.btnAdd.setVisible(true);
panel.btnAdd.setAction(new AddPictureAction(panel));
panel.updateUI();
} else if (titel.equalsIgnoreCase("dienst")) {
}
}
}
Have you called this line in your code?