How do I close a JDialog window using a JButton?
问题 I've tried a bunch of different ways to close the window, but since you can't send additional parameters to to Action Listener method I can't dispose the frame due to a pointer exception for the frame. This is my current code. import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; public class errorRequiredFieldMissing extends JDialog{ JLabel error; JButton exit; public static JFrame frame; public errorRequiredFieldMissing()