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 9152097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:57:38+00:00 2026-06-17T11:57:38+00:00

i want to get the values from the textfield from the class DATAENTRY into

  • 0

i want to get the values from the textfield from the class DATAENTRY into my current class SoilTable in order to make the table work

private void btgetinvActionPerformed(java.awt.event.ActionEvent evt) {                                         



    try {                                 //my class DATAENTRY from which i have to fetch the value of textfield tf_rm_id
        DBUtil util = new DBUtil();
        Connection con = util.getConnection();
        PreparedStatement stmt = con.prepareStatement("select COUNT(box_no)as total from mut_det WHERE rm_id = ?");
        ResultSet rs;
        String rm = tf_rm_id.getText().trim();
        stmt.setInt(1, Integer.parseInt(rm));
        rs = stmt.executeQuery();
        while (rs.next()) {
            tf_boxno.setText(rs.getString("total"));
        }

this is my class where i want to substitute the value of textfield tf_rm_id for the ? parameter

      try {                                               // My current class SoilTable
        DBUtil util = new DBUtil(); 
        Connection con = util.getConnection(); 
        Statement stmt = con.createStatement();
        ResultSet rs = stmt.executeQuery("select * from soil_det where rm_id=?");
        String rmn = (tf_rm_id.getText() == null || tf_rm_id.getText().equals("")) ? "0" : tf_rm_id.getText();
        stmt.setLong(1, Long.parseLong(rmn));
  • 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-06-17T11:57:39+00:00Added an answer on June 17, 2026 at 11:57 am

    If I understood well (your code is not very clear) I would create a method and return that value.

    In your other class I would create an object of that class and call that method then assign it to another value if you want to, like:

    //DATAENTRY class

      public String getVal()
      {
          return tf_rm_id;
       }
    

    //SoilTable

     DATAENTRY textFieldVal = new DATAENTRY();
    
     String strTextFieldVal = textFieldVal.getVal();
     //assigned a new value
     strTextFieldVal = " field value manipulated";
    
    //or display it directly:
    
     System.out.println("Value recieved: "+textFieldVal.getVal());
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to get values from a row with the largest certain value (in
I want to get three highes values from my array, but it should be
I want to get random keys and their respective values from a Map. The
I am trying to select three values from xml document. I want to get
I want to get the query name and values to be displayed from a
Using Access 2003 I want to get a table value from the two databases
I want to take input from a textfield and turn it into an array
I want to get the values from the database to generate a listbox which
i want to sum to values which i get from a textfiel. how can
I want to get the values from all 4 rows of the wheel, and

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.