Don't know, but it looks wrong to dispose the frame when you have not finished with it. It also looks wrong to create a new instance at the end of the method.mitchell bat wrote:Could the . . . code have something to do with it?
Don't know, but it looks wrong to dispose the frame when you have not finished with it. It also looks wrong to create a new instance at the end of the method.
Can you access the database without the GUI?
I presume also that you have a (public?) interface to your business logic which can be used by the GUI.
What are you going to do if you open a branch at Adelaide?
Why are you calling setString(1, issueDBField)? Is that field suitable for use as a String to supply to a database update?
You should not use two frames. You should make dialogue windows visible if you need something to appear and disappear. As an alternative, you can use card layout to make the components you want visible come to the front, and later go to the back and disappear from view. Multiple frames sounds like a bad idea.mitchell bat wrote:. . . that's how I have created my buttons when I need to go from one frame to another
You should never assume anything in programming. You should ask somebody who knows the answer or look in the API documentation (or both). The setString method adds a String to the database update; if, later, the update is successfully executed, the String is added to the database. In that case, if issueDBField is a String, it is badly named. The name of a variable should make it obvious what it means; that name obscures its meaning and confused me into thinking it was a field of some sort. Remember that Swing has about three classes called JSomethingField.. . . I think that the setString method taking the issueDBField string and storing it inside the database. Is that the wrong assumption?
You should not use two frames. You should make dialogue windows visible if you need something to appear and disappear. As an alternative, you can use card layout to make the components you want visible come to the front, and later go to the back and disappear from view. Multiple frames sounds like a bad idea.
You should never assume anything in programming. You should ask somebody who knows the answer or look in the API documentation (or both). The setString method adds a String to the database update; if, later, the update is successfully executed, the String is added to the database. In that case, if issueDBField is a String, it is badly named. The name of a variable should make it obvious what it means; that name obscures its meaning and confused me into thinking it was a field of some sort. Remember that Swing has about three classes called JSomethingField.
when it comes to storing the data in the database is the best way to do it by having the code in the action listener or is there a better way?
All things are lawful, but not all things are profitable.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |