|
@@ -80,17 +80,9 @@ public class SimulationMenu extends JMenuBar {
|
|
|
File[] files = fileChooser.getSelectedFile().listFiles();
|
|
|
for (int i = 0; i < files.length; i++) {
|
|
|
if (files[i].toString().endsWith(".java") || files[i].toString().endsWith(".class")) {
|
|
|
- String name = files[i].toString();
|
|
|
- int tmpS = name.lastIndexOf('/');
|
|
|
- int tmpBS = name.lastIndexOf('\\');
|
|
|
- int tmpA;
|
|
|
- if (tmpS > tmpBS) {
|
|
|
- tmpA = tmpS;
|
|
|
- } else {
|
|
|
- tmpA = tmpBS;
|
|
|
- }
|
|
|
+ String name = files[i].getName();
|
|
|
int tmpB = name.lastIndexOf('.');
|
|
|
- name = name.substring(tmpA + 1, tmpB);
|
|
|
+ name = name.substring(0, tmpB);
|
|
|
algosHash.put(name, files[i]);
|
|
|
algoCombo.addItem(name);
|
|
|
}
|