• Post Reply Bookmark Topic Watch Topic
  • New Topic

Please help with coding this project for me.  RSS feed

 
Jason Hart
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could someone help me with this as I have been reading and just can't figure this out. Through DESIGN tab in NetBeans I was able to make this dialog box the way I want but I have no idea how to code it to do what I need. I want to be able to enter LAST NAME, FIRST NAME, HOURLY RATE, HOURS WORKED and choose the DEPARTMENT they work in on the left and when you hit submit it adds all that info to the box on the right and allows you to keep entering info and every time it submits it adds the info to the right. Can anyone help me here please?

 
Campbell Ritchie
Marshal
Posts: 56536
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stop using NetBeans. You get scores of lines of incomprehensible code for the group layout, and cannot see what is going on.

Please explain what you mean about adding the info to the right.
Why are you using a pop up menu? Why don't you try a dialogue? I suggest you start with a dialogue which returns one value, e.g. first name, then another for last name. and keep going until you fill the array.
Then see if you can work out how to add things to a dialogue. You can add text fields to a dialogue. And when I said fields I meant fields; you can add multiple components. Start with one text field and then see how you add a second field. You may need to add a panel to the dialogue to contain all the text fields.
 
Jason Hart
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:Stop using NetBeans. You get scores of lines of incomprehensible code for the group layout, and cannot see what is going on.

Please explain what you mean about adding the info to the right.
Why are you using a pop up menu? Why don't you try a dialogue? I suggest you start with a dialogue which returns one value, e.g. first name, then another for last name. and keep going until you fill the array.
Then see if you can work out how to add things to a dialogue. You can add text fields to a dialogue. And when I said fields I meant fields; you can add multiple components. Start with one text field and then see how you add a second field. You may need to add a panel to the dialogue to contain all the text fields.


Hi, I made a new post because I thought this one was lost some how, dang now I have two. Anyway this is week two assignment for my java class but it is very advanced to what I know. Last week I had to make a single dialog box with the text "Hello World" and this week an actual program which I am killing my brain with tons of Youtube videos and websites trying to figure out. Oh and NetBeans is required for the class, that is why I am using it.

I created the GUI with the Design tab but now I can't figure out how to get the information to pop up in the chart I created to the right when I hit the Submit button. Of course I don't even know how to get the Submit button to do anything. This is an online course so I am teaching myself and this is so very hard to teach myself. I don't even know how to add a second class to a project and I am sure I need to do that.

My head hurts, can someone help me with a little code? I don't want any of you experts to do the assignment for me but if you can show me how to do a few things that would help me greatly.

1st - I did set variables for each input field but I have to hit TAB to get to the next field where users normal would hit ENTER, how do I do it so ENTER also goes to next field?
2nd - How do I get the SUBMIT button to then take the variables from those fields and enter them into the chart I have on the right?
3rd - How do I get it to repeat this process for as many employees as the user wants to enter?

I am sure this is very simple to most but I am at a total loss. Thanks in advance to everyone who can help.

 
Jason Hart
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh here is a screenshot of the GUI I created that I am hoping to be able to code around because it is setup nicely for what the assignment is so you can get a visual of what I am trying to do.

 
Knute Snortum
Sheriff
Posts: 4276
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I merged your stuff with the following thread. I hope that is okay by you.
 
Jason Hart
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My assignment is to create a payroll app that allows you to enter several employees info and list it all. I created the GUI with the design tab and have it looking exactly like I would like and now need to be able enter the data and have it displayed in the chart. Here is where I am stuck because last week all we had to do was make a box that said "Hello World' and this week it is 1000% more advanced. Can someone kinda show me how to do this (not do it for me but show me like how to bring data over to chart and how to make the submit button do this etc. This is done in NetBeans as required by the course. Please, I need help.

 
Knute Snortum
Sheriff
Posts: 4276
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is where you need to start:



This is the method that is executed when the submit button is pushed. You want to get the text from your JTextField objects (the first is called firstName) and update the table, I'm assuming.

Does that get you started?
 
Jason Hart
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Knute Snortum wrote:This is where you need to start:



This is the method that is executed when the submit button is pushed. You want to get the text from your JTextField objects (the first is called firstName) and update the table, I'm assuming.

Does that get you started?


Not really, I know what I need to do I just don't know how to go about it. Anyway you can show me how to make the submit button enter the data to the table. At least one column like Last Name and then I can figure out how to propagate the rest into it. Complete newb here and just can't figure out how to do it.
 
Campbell Ritchie
Marshal
Posts: 56536
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Start with this (from KS' post):-That may appear useless but it has a use: it allows you to see whether your button has been pushed. Obviously you will change the contents of that method.

I have already suggested how you can fill one line of the table. Have you not tried my suggestion? What happened when you did?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!