Weird issue that gets solved with println

I am writing a code for GUI frontend and Springboot backend. In gui i have methods that doesn't show any errors or bugs, they never function or work unless i insert System.out.println(" "); into them I never ran into such issue Here is an example: When pressing add this method gets called
private void AddPatientBActionPerformed(ActionEvent evt) {

Patient patient=new Patient();
patient.setName(PatientNameT.getText());
patient.setId(Integer.parseInt(PatientIDT.getText()));
patientAPI.save(patient);
PatientTableFiller();
}
private void AddPatientBActionPerformed(ActionEvent evt) {

Patient patient=new Patient();
patient.setName(PatientNameT.getText());
patient.setId(Integer.parseInt(PatientIDT.getText()));
patientAPI.save(patient);
PatientTableFiller();
}
but it doesn't work unless i put print ln in it for some reason
No description
9 Replies
JavaBot
JavaBot3y ago
This post has been reserved for your question.
Hey @Ed! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed 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.
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Ed
EdOP3y ago
i dont think so, because its not even connecting to database unless i add print it should insert something to database then make a change to gui, but its neither doing insert or updating gui its like not executing anything but not showing any error its weird
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
imp_o_rt
imp_o_rt3y ago
Where do you call this method? Show the addactionlistener?
Ed
EdOP3y ago
private void actionListeners() {
AddPatientB.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
AddPatientBActionPerformed();
}
});
}
private void actionListeners() {
AddPatientB.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
AddPatientBActionPerformed();
}
});
}
this gets called once the class is called
imp_o_rt
imp_o_rt3y ago
@Ed in constructor? also this method call is not the same as the one that takes an ActionEvent (the called one doesn't take any params)
Ed
EdOP3y ago
i changed it later before you asked about the method yes which is why i say its weird, its 100% reaching this method just not making anything
JavaBot
JavaBot3y 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.

Did you find this page helpful?