hey there. Im using Netbeans.
i have a form where there is a button edit.
when i press it, other form opens, and the selected item on the previous page has to be edited in the databse.
So bottom line, i have to get a String / int that i used on the first form, to another form.
Is there a right way to do this?
I tried something but it didnt work... i dont know why though... maybe because i created a new one, which kinde defines the point.. coz then i dint use the one i created the first time.
This was my class, but given, i dont know if this would be the right way to do this... And i would like to use the right way.
my class
String hel = "nope didnt work";
public void settext(String it)
{
hel = it;
}
public String gettext()
{
return hel;
}
then on the first form
hspersonnelinvolvedclass set = new hspersonnelinvolvedclass();
set.settext("this should be the new text");
the second form
hspersonnelinvolvedclass set = new hspersonnelinvolvedclass();
JOptionPane.showMessageDialog(null, set.gettext());
So there i would get the String.. but i get the "it doesnt work" message..
Would apreciate any help.
Thanx Ruan