• Post Reply Bookmark Topic Watch Topic
  • New Topic

Working with user input  RSS feed

 
Frank Bergers
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all!

I' d like to know what' s the easiest way of working with user input, e. g. the user enters the word "test" and I' d like to work with that afterwards.

Frank
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That depends on the context. What type of application? Command line? Desktop GUI? Web? And what do you mean by 'work with it afterwards'? What exactly do you want to do with it?
 
Frank Bergers
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Steve Luke wrote:That depends on the context. What type of application? Command line? Desktop GUI? Web? And what do you mean by 'work with it afterwards'? What exactly do you want to do with it?


Hi Steve, thanks for your reply!

You' re absolutely right, I should' ve clarified this.
In the end my application should be connected to a database to keep all input stored there and it should also have a GUI. It' ll have no web issues.
But at the moment I' m at the very beginning. There' s only a few coding lines, no database, no GUI. I' d like to start with storing the input data in a file.

I hope that makes it a little bit clearer.

Best

Frank
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately, no, I am not any more clear on the problem, but that could be because you aren't really sure what it is you need or want.

Before you start coding you should thing about what you want to do. Read this article: WhatNotHow. You should write down precisely What you want to do, long before you start thinking about how you want to do it. I find it most useful to pull up a Doc (Word, Google Doc, whatever) and start out as a formal description of what the app is supposed to do, as if I were bringing it to the attention of a manager or customer (I do this even for my personal projects, and I do it for small sub-projects for the larger project I do at work). Even though I rarely show it to others, just formalizing the description helps solidify the idea.

Then I start to write down use-cases, what does it do, why it should do it. Once I have a decent idea of the What, I then start to think about the how - but not in code yet. Think about work flow. What do you want to present to the customer first? What do they do? Once they do it how do you react? What are the possible errors? How should they be addressed? When you have the application described start to finish, then you can start to think about the technology you need to get it implements.

Do want Swing? http://docs.oracle.com/javase/tutorial/uiswing/
Or do you want JavaFX? http://docs.oracle.com/javafx/2/get_started/jfxpub-get_started.htm
Do you want flat file IO? http://docs.oracle.com/javase/tutorial/essential/io/
Or do you want databases? http://docs.oracle.com/javase/tutorial/jdbc/basics/

etc... Since you know What your application needs to do, it will be easier to choose which Tools are needed to build it.
 
Frank Bergers
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see your point, really.
Please forget about that file thing which was actually supposed to be something for testing purposes only.
Ok, let's say: It' ll need a GUI and a database.

I' ll study the articles to get the picture clearer
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Frank Bergers wrote:I see your point, really.
Please forget about that file thing which was actually supposed to be something for testing purposes only.
Ok, let's say: It' ll need a GUI and a database.

Actually, don't.

If you just want to play around with user input (and there's nothing wrong with playing - it's how we learn), I'd start off by looking at the Scanner class (java.util.Scanner) and write some test programs that can get a variety of different "things" from the keyboard and store them. All you need apart from that is a few println() statements to make sure that what you've got is, in fact, what you expected.

Specifically: Don't worry about files, or GUIs, or databases - at least not for the moment. Concentrate on the problem: user input.

You may also find the UserInput page worth reading, because there's quite a lot to know about the process.

HIH

Winston
 
Frank Bergers
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Winston,

that was exactly what I was looking for: a deeper useful description.
I' ll work through this.

Thank you very much!

Frank
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Frank Bergers wrote:Thank you very much!

You're most welcome. HIH.

Winston
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!