We are about to switch to a new forum software. Until then we have removed the registration on this forum.
How would I go about adding letters placed inside the pane to an array so that it saves for printing? (pseudocode)
String x;
x= JOptionPane.showInputDialog(null, "letter entry");
char y= x.charAt(0);
So it takes x and turns it to a char, but how would I add the letters inputted into an array? It takes one letter at a time, so new letters would be added as each input is accepted.
Also, how would I be able to prevent duplicates in this? Say the user entered "a" and tried to enter "a" again, it would create an error dialogue and ask for a different letter. Thanks in advance :)
Answers
Maybe this could help: https://github.com/GoToLoop/Inputs
Kf
https://Gist.GitHub.com/GoToLoop/bba0c288aaeeb5ef9bb1
I ended up just using String xxx+= y (as per the above example).
Is there a way to prevent duplicates in this way? I'd like entries to be singular and not repeat.
@GoToLoop what's the difference between https://github.com/aerrity/Inputs and https://github.com/GoToLoop/Inputs? In fact, the former seems to be ahead of your one.
@Lord_of_the_Galaxy, that link @kfrajer's posted is merely a fork I did of its original repo! ^#(^
And hence, it's just a screenshot of the moment it was forked, frozen forever in time! :!!
Then it would be wiser to post a link of the original.
Most of my examples includes various links in their header already: :-c
@GoToLoop
How can I tell it was not the latest version? I didn't pay attention to the version but then, I didn't know there were multiple repos.
Kf
@kfrajer, in order to send fixes to a GitHub repo, we need to create a fork of it, which is a screenshot of its current state. :-B
For latest versions, we need to go to the original repository, not to its forks. =;
Also, when starring some repo, make sure it's the original 1 instead of its many forks. ;;)
How can I tell @GoToLoop?
Kf
There's a book icon at the left side of the original repo's name:
https://GitHub.com/aerrity/Inputs
And for forked repos, at the same spot as it was the book icon, it shows this strange icon instead:
https://GitHub.com/GoToLoop/Inputs
Thanks @GoToLoop. Right below the fork icon, I can join the main repo.
Kf