We know that Scanner is one of the many ways used for interaction purpose,through java console. Is there any UI equivalent of Scanner other than Swing?
We know that Scanner is one of the many ways used for interaction purpose,through
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What do you want to do? Scanner is a utility for making inputs from streams and files easy.
For GUI, you need a GUI element, and the ones java provides are based on swing. You can use
JOptionsPane.showInputDialogfor getting basic input and useScannerover this string (Scannercan operate on Files, Streams and Strings. See the constructors ofScanner.If you don’t want Swing, you can use JFace
InputDialog, or build your own dialog.Update
Looks like you are porting a console application to a web application, and need an alternative for console inputs.
This depends on console input. If what you are getting from the console is configuration parameters, you can use a properties file or xml file. If what you get is dynamic user input, you have to create a JSP. You probably have a server and a servlet. If not you have write them too.
Try looking for some servlet and JSP tutorials on how to get started.