Class CEPUtils
java.lang.Object
br.com.pethub.utils.CEPUtils
This class provides a utility method to fetch and fill address details based on a given CEP (Postal Code in Brazil).
It uses the ViaCEP service to fetch the address details.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
buscarCEP
(JTextField cepField, JTextField addressField, JTextField districtField, JTextField cityField, JComboBox ufField) This method fetches the address details for a given CEP and fills the details in the provided fields.
-
Constructor Details
-
CEPUtils
public CEPUtils()
-
-
Method Details
-
buscarCEP
public static void buscarCEP(JTextField cepField, JTextField addressField, JTextField districtField, JTextField cityField, JComboBox ufField) This method fetches the address details for a given CEP and fills the details in the provided fields.- Parameters:
cepField
- The text field containing the CEP.addressField
- The text field to be filled with the fetched address.districtField
- The text field to be filled with the fetched district.cityField
- The text field to be filled with the fetched city.ufField
- The combo box to be filled with the fetched state.
-