Remember, the “model” contains the data and the “view” displays them, so you might have something like... inside the “control”, which manipulates the data and updates the “view”.
Campbell Ritchie wrote:I think that would be a serious error.
Is there memory issue on this approach? Or it is just a design error?
myyron latorilla wrote:Is there memory issue on this approach? Or it is just a design error?
The latter. static fields should generally only be used to define constants, and should therefore also be final.
Robert Leon wrote:i have text fields for CustomerTFN and Surname and what i want is to show them in the second form which is the booking form I think a Module declaration for those field would be the solution but i dont know how to do that...
And neither do we unless you show us your code (and only the relevant bits please).
For example, where do these CustomerTFN and Surname fields come from? Sounds to me like you may have a Customer object behind the scenes.
PS: When you do post your code, please:
1. UseCodeTags (←click).
2. Break up any very long lines (> ≈80 characters). They tend to screw up the windowing here.
I hope you don’t think there is such a thing as “just a design error” Design errors are much more serious than using a bit of memory.
myyron latorilla wrote: . . . Is there memory issue on this approach? Or it is just a design error?
Yes, it is a serious design error to mark something static which ought not to be static.
my problem is not a design error I hope this time I can be more clear
1. all this 3 form are tables in my database and i have to store each field to their tables which are customers, booking and taxreturns
2. my customer form is the one for starting the program where I enter the customer details.
3. I can insert update delete and search for a customer
4. The second form is for making a booking to do the tax return and the third form if for making the calculation or the tax return
I have no problem so far working with the data base all is good
what i need is:
from the Customer Form I want CustomerTFN and Surname to be display in the other forms. for example if you can see my screen shots. I have the same CustomerTFN and Surname in my Booking Form how can I display them from the Customer Form. If i would do this program in Visual Basic I can make a module or global declaration and end of problem but in Java I dont know how to do it.
i will show a bit of my code if help:
1.-From customer class
3.- what i need to do is this in the third form which is Booking Form
this bit is from the booking form i need to display the customerTFN from the CustomerCLass as i got the set and get method but if i can have a global declaration i can call this methods from any class inside the project
Don’t you have some sort of “accept entry” button? Can’t you get all that validation done when the button is pressed, using an ActionListener?
Or can you use some sort of Listener on the text which does the validation when you reach 11 characters?
Winston Gutkowski wrote:
Robert Leon wrote:i
Can you help me please
That is the sort of thing I meant about failing to match after the first ten keystrokes.
Robert Leon wrote:To Campbell: I am using a text Area where I can see the error message because if i use a message box it will pop up everytime i release the button thats why i dont use a message box