}
public void actionPerformed(ActionEvent e) {
RouteGroup selectedRouteGroup = (RouteGroup) (routeGroupList
.getSelectedValue());
Route routeToDelete = (Route) (routesList.getSelectedValue());
if (routeToDelete == null) {
JOptionPane.showMessageDialog(RoutesConfigurationDialog.this,
"Please select a route", "Error",
JOptionPane.ERROR_MESSAGE);
return;
}
int response = JOptionPane.showConfirmDialog(
RoutesConfigurationDialog.this, "Really remove Route '"
+ routeToDelete.getName() + "' ?", "Remove Route",
JOptionPane.YES_NO_OPTION);
if (response == JOptionPane.YES_OPTION) {
try {
RoutePersistenceIface routePersistence = AdHocRailway
.getInstance().getRoutePersistence();