wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Gui help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Gui help" Watch "Gui help" New topic
Author

Gui help

Liam h
Greenhorn

Joined: Apr 05, 2005
Posts: 5
hello all,

I am new to java and would like to get some help, i have a gui and i would like to get some advice for making the gui do what i want it to do!!

The problem is that i don't know how to approach it, i want to place a string of keywords in the program and when the user enters a string into the gui. I want to compare the string entered with the words in the keyword string
Steven Bell
Ranch Hand

Joined: Dec 29, 2004
Posts: 1071
It would probably be easier to help you with this by doing little pieces at a time.

First identify the question, there are a few I can guess at from your post.
How do I get data from a Component?
How do I perform actions based on user interaction?
How do I layout a simple GUI?

These are just the ones related to the GUI that I see. Pick one of these (or something else if I missed your real question) and we can go from there.
Liam h
Greenhorn

Joined: Apr 05, 2005
Posts: 5
Hey Steve,

Thanks for your time...

In the GUI, I have a jButton and a textField this how I'll get the data from the component.

I think What I am trying to do is in the actionListener is have the code to compare the input string with a string of keywords.

This is where I have the problem, which way should I go about it or what methods ot use.
Steven Bell
Ranch Hand

Joined: Dec 29, 2004
Posts: 1071
Do you mean you have a String that you got from the user, and you have an Array of Strings to compare it to?

That depends on what kind of comparison you want to make. At a guess you're not looking for a simple equals().

Are you looking for:
userString is contained in one of the systemStrings?
userString is close to one of the systemStrings?

Also this question doesn't seem to be realated to the GUI, but the String processing so it probably should have been in the 'Java in General' forum. Not really a big deal, but one of the moderators might move it.
Liam h
Greenhorn

Joined: Apr 05, 2005
Posts: 5
I realise that this not related to GUI, I could not find the right forum, sorry should have looked harder.

Yeah I have a string that i get from the user and compare it to an array of strings.

I am looking for userString is contained in one of the system strings
Steven Bell
Ranch Hand

Joined: Dec 29, 2004
Posts: 1071
Liam h
Greenhorn

Joined: Apr 05, 2005
Posts: 5
thank you very much,

I will give this a try...

and again thanks for your help
Steven Bell
Ranch Hand

Joined: Dec 29, 2004
Posts: 1071
P.S. If you plan to continue posting here at the ranch you will be asked to change your user name to appear as a first and last name that is at least real sounding. It is part of the naming policy.

Glad I could help.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

soup,

Welcome to Javaranch!! We don't have too many rules around here but we do have a Naming Policy. Please adjust your display name accordingly.

Thanks.


GenRocket - Experts at Building Test Data
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Gui help
 
Similar Threads
Wrinting a string vertically
Addind a word in the String
GUI in java
how to get input without echo
calling C programs from java