title: custom dialog box in java
body: <p>I was trying to build a custom dialog box using the following code.</p>
  
  <pre><code>public class CustomDialog
  {
  
      JTextField firstName;
      JButton jb;
      public CustomDialog() 
      {
          firstName=new JTextField();
          jb= new JButton("Browse");
          final JComponent[] inputs = new JComponent[] 
          {
                 new JLabel("SDK Path"),firstName,jb
          };
          JOptionPane.showMessageDialog(null, inputs, 
                  "Enter the SDK Path", JOptionPane.PLAIN_MESSAGE);   
      }
  </code></pre>
  
  <p>The result of this code has the textfield followed by button and then OK in vertical manner. I wanted to have the button beside the OK Button. How can I do that??</p>
  
  <p>How can I change OK Command's caption to "Save" ?</p>
  
  <p>Please help me regarding this.</p>