Suggest the Proper Time to Ask, Populate TextAreas, and Read a File
This is my first post here and I'll try to do it as well as I can and not mess to much up.
Background to Present
I wrote a stock percentage calculator in python about 2 years ago because I wanted to know how much total value change had occured with my 7 stocks at any given time and I had never written anything in python so it was a good learning experience. I wrote it so that it ran from the command line with all text prompts. I now want to update it, port it to Java, and have a graphical user interface (GUI).
I should start with where I am at right now. I have created an algorithm of what I would like to accomplish with this program (my algorithm skills are not well developed but it should help to illustrate what I'd like to accomplish so you all can effectively help me with my questions). I also created a visual of what I'd like the GUI to look like. I did this to illustrate (and because GIMP is fun :(happy):) if I will be able to dynamically populate the GUI according to a text file that is read with stock information (jFileChooser) or with a jOptionPane that runs before intializing the GUI that can populate how many stocks the user wants to calculate. I think it would be possible to open a blank GUI and have an "add stock" button that created fields until the user had as many as they wanted and could calculate their percentage, but I'm not sure if that would be easier or harder than just populating 3 columns per stock inputed by the user.
I have included the two files at the end of this post.
Problems and Questions
An immediate problem that arises for me is the proper time and place to call the jOptionPane/jFileChooser. I would want to call it before I create the top level window but it isn't as easy as that. I have used NetBeans and it often creates some very ugly and unreadable GUI code, but you do get the ease of using an editor. That option doesn't seem viable since I want to dynamically create a window according to the text file or user input. I'm not adept at writing my own GUI code but I have done it before and had decent results. My two fold question is where would be an effective place to call the jOptionPane/jFileChooser and can you point me in the right direction (Article/API) that would help create those fields dynamically inside that window? Or will it just be iterating through a for loop and creating the fields and labels?
I'm familar with layouts and can research any suggested layouts you think will work. I'm thinking GridLayout or SpringLayout will accomplish this so has anyone done something like this?
Thank you for all and any help to get me on the right path and started.
Stock Percentage Calculator
1. Ask whether to read a text file with all stock names and purchased prices or ask how many stocks to input.
Text file example:
2. Populate the User Interface with TextLabels and TextFields according to that information.
3. Calculate the percentage change in all stocks and then sum the total change.
4. Display the total percentage change in value.
Re: Suggest the Proper Time to Ask, Populate TextAreas, and Read a File
This thread has had quite a few views but no replies, is there something I am missing or does anyone just not have suggestions?