Memory leak when using setText
问题 I have noticed that I have a memory leak in my program. I have traced the problem to the line. Clock.setText("" + h + ":" + df.format(m) + ":" + df.format(s)); I have googled this and it seems to be a common problem but I have not found an answer. Does anyone know a fix? Here is the entire code: package CodeBits; import java.awt.Color; import java.awt.EventQueue; import java.awt.Font; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Insets; import java.awt