Results 1 to 2 of 2
- 10-18-2013, 08:29 AM #1Member
- Join Date
- Oct 2013
- Rep Power
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 ) 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.
Last edited by histamineblkr; 10-18-2013 at 08:30 AM. Reason: Improper image displays
- 10-21-2013, 08:15 AM #2Member
- Join Date
- Oct 2013
- Rep Power
- By priyankakusuma in forum New To JavaReplies: 10Last Post: 04-01-2013, 01:50 PM
- By gurpreet.singh in forum JavaServer Pages (JSP) and JSTLReplies: 8Last Post: 03-09-2011, 12:22 PM
- By ganeshp in forum Advanced JavaReplies: 2Last Post: 04-07-2009, 06:25 AM
- By jaiminparikh in forum Advanced JavaReplies: 2Last Post: 02-27-2009, 12:56 AM