title: How do I create a new object in java that has the properties of another one without declaring it?
body: <p>For example, I have a JButton with a set icon, name and label;
  How do I make a new JButton that I can add, say, to a panel?</p>
  
  <pre><code>JButton b1=new JButton();
  b1.set[whatever needs to be set];
  JPanel p=new JPanel();
  p.add(new JButton()[that has the properties of b1]);
  </code></pre>