java - How to fire an ActionEvent from a JPanel -
i'm trying repaint simple massage in panel firing actionevent. i have messagepanel extends jpanel , in defined addactionlistener method , processevent method process event: import java.awt.graphics; import javax.swing.jpanel; import java.util.*; import java.awt.event.*; public class messagepanel extends jpanel { private string message = new date().tostring(); arraylist<actionlistener> actionlistenerlist; public messagepanel(string message) { this.message = message; } public void setmessage(string message){ this.message = message; } public void addactionlistener(actionlistener listener) { if (actionlistenerlist == null) { actionlistenerlist = new arraylist<>(2); } if (!actionlistenerlist.contains(listener)) { actionlistenerlist.add(listener); } } public void removeactionlistener(actionlistener listener) { if (actionlistenerlist != null ...