Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String index out of range! #11

Open
akanshSirohi opened this issue May 22, 2019 · 2 comments
Open

String index out of range! #11

akanshSirohi opened this issue May 22, 2019 · 2 comments

Comments

@akanshSirohi
Copy link

java.lang.StringIndexOutOfBoundsException: String index out of range: -1
My code looks like this

String url=urls.get(options_list.getSelectionModel().getSelectedIndex());
String filename = file.getAbsolutePath();
DownloadManager downloadManager = DownloadManager.getInstance();
DownloadMission mission = new DownloadMission(url,"",filename);
downloadManager.addMission(mission);
downloadManager.start();
@deVDem
Copy link

deVDem commented Jan 9, 2020

You may have a problem on the first line of the attached code. Maybe the index is taken wrong

@themhassany
Copy link

java.lang.StringIndexOutOfBoundsException: String index out of range: -1
My code looks like this

String url=urls.get(options_list.getSelectionModel().getSelectedIndex());
String filename = file.getAbsolutePath();
DownloadManager downloadManager = DownloadManager.getInstance();
DownloadMission mission = new DownloadMission(url,"",filename);
downloadManager.addMission(mission);
downloadManager.start();

please include the complete exception. since it is not clear if the raised exception is even related to the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants