posted 15 years ago
Hi guys,
Thanks for your quick and helpful responses.
I managed to get a lot of code done that works fine when I run my program but I still have a few issues...
What I'm still struggling with is these points: (from the assignment specs)
My first problem is at the line-
"and only adds information if it is in correct format" at the point (*1) in my assignment specs.
When I run the program, and input e.g. - 'abc' in the name and surname textfield and press enter
(which is wrong format), an error message is thrown via the 'messageLabel' at the bottom of the frame, thus far the program is doing what it is supposed to do.
Then I input e.g. - '9' in the phone number textfield and press enter (which is also in the wrong format), again an error message is thrown via the 'messageLabel' at the bottom of the frame, and so far so good.
But when I click on the 'ADD ENTRY' button, the program adds the entry although one or both of the textfields' input was incorrect.
I do not know how to rectify this problem, could you PLEASE help me with this?
My second problem is with "*5 Use a JTable placed inside a JScrollPane to show all the name-number pairs." -
I have created a new class called 'myTable' and in this table is all the code to create the JTable and the JScrollPane
I know that my code is incorrect, but my problem is, is that I do not know how to code a 'TreeMap'(which I'm using to store and store all the entries) to an array to use in the table.
What I want the program to do is when I click on the 'VIEW ALL ENTRIES' button it should call the 'myTable()' method from the 'myTable' class and output all the name-number pairs accordingly.
Please I need your help with this...
Here is my program code this far:
Further assistance from you guys would be much appreciated.
Thanks in advance
Regards