Jamie Porro wrote:...and having typed the month will get a response on all astronomy events happening in the given month
All things are lawful, but not all things are profitable.
Jamie Porro wrote:...I will be simply getting the events that take place online not looking to link data to anything ...
If (user enters January for example)
System.out.print (all events within this given month)
All things are lawful, but not all things are profitable.
Knute Snortum wrote:
Jamie Porro wrote:...I will be simply getting the events that take place online not looking to link data to anything ...
I think you need to define what "simply getting the events that take place online" means.
If (user enters January for example)
System.out.print (all events within this given month)
By simply, I mean I will google "astronomy events" find a list of events over the given year.
Okay, so now what is the pseudocode for "all events within this given month"?
Dave Tolls wrote:I would still get that part working first.
That is, having some code that will handle the "answering" of the question, and stick a simple terminal front end instead of a GUI.
I'm still not sure how you plan on doing it (though maybe a file-per-month and then simply display that?)...
Jamie Porro wrote:I think the best thing for me to do is create what I think I want to create code wise and then come back to you all on this and see where that takes us!
Campbell Ritchie wrote:Don't like it at all, I am afraid.
You should be able to use a switch rather than those repeated ifs.
You have a main method much much too long.
There is very little coding to the blocks of print instructions. All you are doing is printing a list of ephemeris.
Fred Kleinschmidt wrote:Your program should not hard-code the information to be printed - otherwise it will become obsolete after the last month you include.
You should instead put that information in an external file or database, and the program should read the information from that file.That way you can just update the file and send your frient the updated file, and the program will not have to be rewritten every few months.
Dave Tolls wrote:OK, when you say "LCD with touch" what device are you planning on running this on?
Since you plan on having a GUI you are going to need to create a class (a DAO, or DataAccessObject) that handles your data.
You would probably get away with it only having a simple Map<String, List<String>>, which is a Map that maps the month names and returns a List of Strings, which are your events.
And the DAO (DataAccessObject) would simply have a method called getEvents(String) which takes a month and returns the list of events.
This is a small step up from where you are at the moment, but is something you should be able to achieve easily enough.
Dave Tolls wrote:Well, I suspect it then comes down to budget I suppose?
And whether Java runs on whatever device is chosen.
Obviously, a cheap Android device comes to mind.
And before you actually purchase one, you could get hold of Android Studio, create your app, and test it in the emulator it comes packaged with.
No point splashing out until you have an actual app.
There may be cheaper ways to do it (Raspberry Pi, or Arduino?), but I have no idea on that.
Carey Brown wrote:Just curious. Why an LCD display vs just using the computers console? Is it expected that the end user is not capable of running a GUI app? How would an LCD app be any better?
Jamie Porro wrote:my hope is that if I can make that work on an LCD then I could t eventually make it portable (this in not expecting to be able to do with my time frame but can build open hopefully)
Question, how easy is it to make a GUI app?
Carey Brown wrote:It seems that using a text file to supply events would be a good way to go. Here's a small sample delimited with the '|' character. The fields are: start date, optional end date, and event description. It should be relatively straight forward to create a small class to support these fields and a way to select them by month. Have you worked with lists or arrays at all?
Carey Brown wrote:
Jamie Porro wrote:my hope is that if I can make that work on an LCD then I could t eventually make it portable (this in not expecting to be able to do with my time frame but can build open hopefully)
Question, how easy is it to make a GUI app?
Making it portable: You are probably talking a Raspberry Pi with LCD or building an Android app. An Android app would probably be easier and could build on any Java knowledge that you have. Whether Android or a Swing GUI is more difficult is hard to say. Swing has better support from development environments as opposed to Android which you would have to download to a phone for testing or run under a simulator.
I think your current path, that of creating a textual user interface first, is a good way to go. That allows you to concentrate on data structures and logic and get those thoroughly debugged.
Dave Tolls wrote:Well, if it's to go on a laptop then that would solve target environment.
It would also be simpler, since you won't need emulators, and if it works on your machine it should work on his.
Carey Brown wrote:If you want to display multiple lines of text use a JTextArea.
Carey Brown wrote:if( userInput.getText().equals("January") )