OK, I am back. I completely under the getter/setter concept. However,
what I am trying to do is create a property that can be used to pass
values between forms (JFrames).
If I had two JFrames, one being say, employee basic information
(Form1), and the other containing extended info about the same employee
(Form2). When I open Form1 to an employee record, then, in Visual
Studio for example, I would then create a property in Form2 like so:
private string _employeeID;
public int employeeID
{
get { return _employeeID; }
set { _employeeID= value; }
}
In Form1 I set the Form2 property when the form instance is created as
follows:
Form2 frm = new Form2();
frm.employeeID = xxxxx
Finally, in Form2, I can use the _employeeID value to populate the form
with data.
Most of my apps I do are based off of a database design or concept, and
a significant part of the model for my applications start there (at the
database). Anyone know of any good tutorials or books regarding
database-cebtric application design using Java?
Thanks again.
eotgibym@yahoo.com wrote:
I am new to java (currently using C#). I am trying to learn java and I
am having a little difficulty in creating and using a property. Here
is a sample from C#:
private int _myValue;
public int myValue
{
get { return _myValue; }
set { _myValue = value; }
}
how would I do this in java? Any help is appreciated.
changed. That method would then change the displayed data on Form2 to
keep the info in sync. So, rather than have Form2 pull the info from
exposed method.
use MySQL for most of my database work.