0% found this document useful (0 votes)
34 views1 page

(Field1 Getfieldtext (Field1.Gettext ) ) : Class

Class1 contains a JTextField called field1 and a method getFieldText() that returns the text from field1. Class2 contains a JTextField called field2 and a constructor that takes a Class1 object as a parameter, which sets the text of field2 to the result of calling getFieldText() on the Class1 object.

Uploaded by

trustmeon18
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views1 page

(Field1 Getfieldtext (Field1.Gettext ) ) : Class

Class1 contains a JTextField called field1 and a method getFieldText() that returns the text from field1. Class2 contains a JTextField called field2 and a constructor that takes a Class1 object as a parameter, which sets the text of field2 to the result of calling getFieldText() on the Class1 object.

Uploaded by

trustmeon18
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

class Class1

JTextField field1;

public String getFieldText()

return field1.getText();

class Class2

JTextField field2;

Class2(Class1 c1)

field2.setText(c1.getFieldText());

You might also like