Search code examples
javaswingjbutton

how to reach JButton from main function


I created a window named "okno", where I have JButton named "tlcOdejit" and I wanna disable that button when I read some text from input. But when I type

okno.tlcOdejit.setEnabled(false);

compiler is telling me "cannot find symbol -> tlcOdejit". I am able to use function for JTextArea like

okno.textArea1.append(line);

for type a line into my textArea, but I am not able to reach this way the button. Could you tell me, what am I doing wrong?


Solution

  • Is tlcOdejit public? If not, that could be the problem.