The wording of your question is a little weird, so my apologies if I answer wrong. If you're asking how to import scanner you type this outside of the class
And to create the scanner object you type this in the main method (or whatever method you're using it in):
Scanner input = new Scanner(System.in);
You can use a TextField or a TextArea class to achieve what you want. TextField can only hold a single line but TextArea can hold multiple lines. Also you have to import applet and awt api.
You can then create an instance of the above classes and use setText() and getText().