Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

  ===SectionShortTitle:Return JDialog SectionLongTitle:Return JDialog SectionContent:

  <p>By default,all dialog boxes from JOptionPane are not resizable.To customize them so that they are resizable,use the createDialog()methods of JOptionPane.</p>

  <p>The following code displays the custom resizable dialog box.</p>

  <myPreCode>

  import javax.swing.JDialog;
  import javax.swing.JOptionPane;

  public class Main {
public static void main(String[] args) {
  JOptionPane pane = new JOptionPane("JOptionPane",
      JOptionPane.INFORMATION_MESSAGE);
  String dialogTitle = "Resizable Custom Dialog";
  JDialog dialog = pane.createDialog(dialogTitle);
  dialog.setResizable(true);
  dialog.setVisible(true);

}
  }</myPreCode>===