Source Code : Create simple about dialog

Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com. Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com. Click Here or search from google with Libraries Name you get jar file related it

Create simple about dialog

Create simple about dialog
   
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.Box;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class SimpleAboutDialog extends JDialog {
  public SimpleAboutDialog(JFrame parent) {
    super(parent, "About Dialog", true);

    Box b = Box.createVerticalBox();
    b.add(Box.createGlue());
    b.add(new JLabel("Java source code, product and article"));
    b.add(new JLabel("By Java source and support"));
    b.add(new JLabel("At www.java2s.com"));
    b.add(Box.createGlue());
    getContentPane().add(b, "Center");

    JPanel p2 = new JPanel();
    JButton ok = new JButton("Ok");
    p2.add(ok);
    getContentPane().add(p2, "South");

    ok.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        setVisible(false);
      }
    });

    setSize(250, 150);
  }

  public static void main(String[] args) {
    JDialog f = new SimpleAboutDialog(new JFrame());
    f.show();
  }
}
           
         
    
    
  

Thank with us