Java Swing (jtextfield)

Boa tarde pessoal, tenho uma dúvida, quando executo este projeto, porque só digitar no swing ele não aparece os dados, mais ao pressionar o botão de = aí sim mostra o resultado da soma? Alguém pode me ajudar a resolver isso, para que quando eu digite os dados na tela gráfica, os dados já apareçam de imediato? Porque só está aparecendo após pressionar o botão de resultado!
No description
No description
No description
8 Replies
JavaBot
JavaBot4d ago
This post has been reserved for your question.
Hey @Rodrigo! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here. 💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
dan1st
dan1st4d ago
Please ask your question in English.
JavaBot
JavaBot4d ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.
Rodrigo
RodrigoOP3d ago
@dan1st | Daniel I have a question, when I run this project, why just typing in the swing does not show the data, but when pressing the = button it shows the result of the sum? Can anyone help me resolve this, so that when I enter the data on the graphical screen, the data appears immediately? Because it is only appearing after pressing the result button!
dan1st
dan1st3d ago
I guess you wrote the code that your actionPerformed method is only called when you click on the button? you could add a listener for keypresses on the input fields
Rodrigo
RodrigoOP3d ago
This is exactly what is happening, can you explain to me what I should change in the code? What do you call this listener method? I'm just starting out in Java, and learning about swing
Rodrigo
RodrigoOP3d ago
and using the code this way, when I type it happens like in the video
No description
JavaBot
JavaBot3d ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.

Did you find this page helpful?