non-static method setPrzechowaj(java.lang.String) cannot be referenced froma a static context
- by bigbluedragon
hey i have problem with JDialogForm. I have created it using netbeans 6.8. That JDialogForm have textfield and button below it. and here is some code...
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
String sciezka = jTextField1.getText();
if (sciezka.length() > 0)
{
Zmienne_pomocnicze.setPrzechowaj(sciezka);
}
}
Now i want to copy that string "sciezka" to my main window but if I do it like this
public class Zmienne_pomocnicze {
public String n;
public void setPrzechowaj (String neew)
{
n = neew;
}
public String getPrzechowaj ()
{
return n;
}
}
i get error in jButton1: non-static method setPrzechowaj(java.lang.String) cannot be referenced froma a static context
any ideas?