Rich Charlton

Greenhorn
+ Follow
since Nov 11, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Rich Charlton

right i think i have sorted my addClient method now:


Output after entering 5 clients:


The above is what i want which is cool..

Now to my findClient method....This works to a point...It will find a specific name...however when i enter a name not stored i get null exception error then my "Error Client not Found" message. How can i avoid this..or have you allready explained this to me...ive probably got my loop slightly wrong again...for the 400th time...

thanks
17 years ago
Hi,

i have removed making a new branch every time i click the find button on my GUI, and thats seems to of helped.

Heres what i have now..

Only problem now is that when i do click find it just returns whatever i type into the textfield. It is not searching the array for stored items.

Any ideas....
17 years ago
Hi, sorry about this cant seem to get the logic right..
Firstly my GUI gets the text name input

which passes the values name, address, telephonenum over to branch class by calling the method add()

The add() calls the method addClient() from customercollection class below


Output is my system.out.println("Error"); obviously my my values are wrong somewhere and the statement if (index == collection.length) has got to be incorrect.

Im not sure why this is not working.
To clarify :[code]
private int arraySize = 5; //this is how many elements i would like to have in the array
public int index = 0; //this is an index for each element

If you have any more help, that would be great

Thanks again..

17 years ago
Sorry to bother you again...

I have a question...

I have slightly changed the addClient method now so that the user cannot store more than 5 users, although when testing my GUI out i can add as many clients as i like without any error message what so ever.

Here's my addClient method:



Thanks again..

[ February 23, 2005: Message edited by: Rich Charlton ]
[ February 23, 2005: Message edited by: Rich Charlton ]
17 years ago
Hi,

Great help thankyou...

I have sorted my add client method out which is much more logical now..

Many thanks

17 years ago
Hi all,
I am having trouble figuring out how to search a collection. The collection holds three strings (name, address, telephonenum) i would like to be able to search using a name as the search criteria.



Branch class that recieves input from estateGUI.


CustomerCollection class which builds the collection and has the method for add/find client etc:


Does anyone have any ideas on how i can find a specific client in a collection.

Thanks
17 years ago
Thanks for your help guys....

I have re written my program logic now...although i have another problem...
I have started a new thread in the intermediate java forum if you can spare a look.

Thanks
18 years ago
Hi,

Im working on a basic email filter, which will read in a text file of several hundred email messages, increment a counter for an individual message, tokenise it, count number of occurences of token in that email then store in a dictionary. I have built a couple of classes that do certain things and they work ok. Although i cant figure out how i can split up each individual message in the text file. At the moment i just read the whole text file in, with no method of splitting the text file up into individual messages. The messages in the text file are split by 10 dashes (----------). Here are my classes so far:
Tokeniser.java
Comwords.java (removes common words like 'the', 'a' etc)
Does anyone have any ideas how i might solve this problem?
Thanks
18 years ago
thats great am able to get the items added in the commonwords class. although im still having a problem removing the items from the initial hashmap. i have changed it slightly now to use an arraylist for the commonwords instead of a hash table as i had no need for a value next to the string.

im not sure whether the remove statement is going to work now.
as counts is a hashmap and cwords is an arraylist of string objects.

so problems at the moment are that i cant instantiate the arraylist and cannot remove commonwords from hashmap.

any ideas thanks.
18 years ago
Hi all,

im trying to build a text classification program that reads in a text file, tokenises it and stores it in a hashmap. Along the way i would like to instantiate another class which reads a text file full of commonwords. I would then like to remove these common words from the initial hashmap. I have set up two classes one called CommonWords.java and the other called Train.java. I am getting an error which i have posted after my code.

Train.java

CommonWords.java

Error Message:

I think i have something wrong with the adding of the commonwords to the hashtable..

Does anyone have any ideas.

Thanks
18 years ago
Hi all,

I have sorted my parameter passing problem now. everything is working

Big thanks to Michael for explaining my problems.

18 years ago
Hi all,

Im trying to do a simple value passing operation i cant seem to get it working correctly. I have two classes one which produces a value and the other that needs that value to do something with it. I have written the code, although i do not get the right result, when i click the confirm button and enter how many tickets i would like the showID integer to be passed over to Cost class using method at the bottom of panel class. I think i have a problem with my call method as it is duplicating the fram twice after i enter a number into the input dialog. Heres my code:

Panel class:

Cost class:

I have highlighted areas of code that are the problem areas.

Does anyone have any ideas why im not getting the desired result ?

Thanks



[ edited to break long lines of code -ds ]
[ November 27, 2004: Message edited by: Dirk Schreckmann ]
18 years ago
Hi,

I looked it up and got it working. Never new about that specific method for JComboBox.

Many Thanks.

18 years ago
Hi,

Thanks for taking a look, ive changed my name now hope thats cool.

As for the answer to my question..where do i put the setselectedindex(0);

Do you have any more clarification...

Thanks
18 years ago
Hi all,

I have written a program with three combo boxes asking user to pick a date. I have one combo for day, one for month and one for year. My problem is that i have designed a for loop to make the numbers 1 to 31 appear in the combo box, although when you run the program you get a blank space where the number 1 should be. Is their way of setting the combo box so that one is shown first, instead of a blank box.

Program:

Any ideas ?

Thanks
18 years ago