Hi, trying to figure out why my JTextField 'scInput' cannot be seen in another class?
I define it in class 'gui' as
private JTextField scInput;
within the public class
public class Gui extends JFrame
implements ActionListener
But when trying to call it in another class, its not being resolved...
public String setStockCode()
{
new Gui();
stockCode = scInput.getText();
}
even after i make a new instance of Gui()
Also, changing it to public from private does nothing, and theyre in the same package.
anyone got any ideas?
Thanks
2007-03-18
20:01:02
·
7 answers
·
asked by
Dave
2
in
Computers & Internet
➔ Programming & Design
Nope, like i said, changing it to public does nothing, since ive made an instance of the method its called in, it can read the private ones, but i did change it and it still doesnt work, scInput (textfield) cannot be resolved...
2007-03-18
20:15:23 ·
update #1