title: Button click calls panel method without arguments
body: <p>I have JFrame and inside that I have JPanel and inside of that I have one button. And when I click I want it call some method with I specify. Is that somehow possible without parameters?</p>
  
  <p>This is how I have done it until now:</p>
  
  <pre><code>JFrame frame = new JFrame("");
  JPanel container = new JPanel();
  frame.add(container);
  
  JButton button = new JButton("Button");
  button.addActionListener( e -&gt; mySpecialMethod());  // I have to create action performed method with has ActionEvent as parameter.
  </code></pre>
  
  <p>...</p>
  
  <p>Is there a simpler way? It seems redundant to do it all the time. Something like <code>button.addActionListener(Foo::bar);</code> and <code>public void bar(){....}</code></p>