Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7003559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:05:06+00:00 2026-05-27T21:05:06+00:00

I currently have 3 classes, a main class containing a GUI, and the fnameTxtField

  • 0

I currently have 3 classes, a main class containing a GUI, and the fnameTxtField, a customer class containing the data, and a customerList class which gathers the data from the customer class, and puts it into an array list.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T21:05:07+00:00Added an answer on May 27, 2026 at 9:05 pm

    Where you are using fnameTxtField.getText, Java is expecting you to declare a method parameter (kind of like declaring a variable). A parameter is information that your method is told about for one particular execution, instead of having to find out on its own.

    So you are right in thinking you want something like this:

    public void searchCustomer(String familyName) {
        for (int i = 0; i < customer.returnID(); i++) {
            customer search = search.get(i);
            if (search.returnFamilyName().equals(familyName)) {
                System.out.println("Index: " + i);            
                //removed  return i;
                return;
            }
        }
    }
    

    Then at the point of invocation (method call) specify that you want to use the value in your text field:

    //...
    searchCustomer(fnameTxtField.getText());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I currently have a main class which might call another class which might call
I currently have (among others) these classes: public class Main extends Activity { Panel
I currently have service classes that look something like this public class UserService :
I have four classes which share some arrangement of four properties. I have currently
I currently have 2 concrete methods in 2 abstract classes. One class contains the
Currently I have a DataModel object which contains my linq to sql classes(a dmbl
Currently, if I have different classes containing functions etc, I would structure them all
Have a question about sending data between classes and activities. I currently have a
I have custom classes that I currently instantiate within App.xaml as resources. I want
I'm currently using the hilo id generator for my classes but have just been

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.