Wednesday, October 15, 2008

Java: En Guard Update #4

The way the program is currently written it is not very easy to modify or add additional components. Due to all of my work with JTabbedPanes with the CharSi application I decided to make a similar change here. To do this quite a bit of code needed to be altered and consolidated.

Up to this point I had two java files in order to create the GUI portion of the program. I decided to consolidate those two files together into a single java file, especially considering one of them was only 60 lines of code long. Problems came up there as I had used the same variable names for different components in each file so once they were combined the GUI was missing pieces. Eventually everything was ironed out.

The next step was to turn the main panel in to a JTabbedPane and each subsequent tab into it's own java file. Using CharSi as a guide this process was not too complex and left me with two workhorse files, Info.java and Search.java. Info.java contains the GUI portion of the application along with the methods utilized to open and save the informational text files.

Search.java will host a search engine that will allow the informational text files to be searched one at a time for a particular string. The resultant list will be displayed in a JList and when a selection is clicked it's contents will be displayed in a JTextArea. The other change that needs to take place is that the Contact Information field will no longer be a required field. It will still be present but the record may be saved without any information displayed. It simply didn't turn out to be as useful as I had hoped.

No comments: