1 23 24 package org.objectweb.clif.console.lib.gui; 25 26 import org.objectweb.clif.util.Version; 27 import javax.swing.JDialog ; 28 import javax.swing.JFrame ; 29 import javax.swing.JLabel ; 30 import javax.swing.ImageIcon ; 31 import javax.swing.JButton ; 32 import java.awt.event.ActionListener ; 33 import java.awt.event.ActionEvent ; 34 import java.awt.event.WindowAdapter ; 35 import java.awt.event.WindowEvent ; 36 import java.awt.Container ; 37 import java.awt.BorderLayout ; 38 39 40 44 public class GuiAboutDialog extends JDialog implements ActionListener 45 { 46 47 48 public GuiAboutDialog(JFrame frame) 49 { 50 super(frame, "About CLIF...", true); 51 Container pane = getContentPane(); 52 pane.setLayout(new BorderLayout ()); 53 pane.add(BorderLayout.CENTER, new JLabel (new ImageIcon (GuiAboutDialog.class.getClassLoader().getResource("icons/logo_clif_60px.gif")))); 54 pane.add(BorderLayout.NORTH, new JLabel ("CLIF is a Load Injection Framework")); 55 pane.add(BorderLayout.SOUTH, new JLabel (Version.getVersion())); 56 JButton okBtn = new JButton ("OK"); 57 pane.add(BorderLayout.EAST, okBtn); 58 okBtn.addActionListener(this); 59 this.addWindowListener(new GuiAboutDialog.WindowCloser()); 60 pack(); 61 } 62 63 64 public void actionPerformed(ActionEvent e) 65 { 66 this.dispose(); 67 } 68 69 70 class WindowCloser extends WindowAdapter 71 { 72 public void windowClosing(WindowEvent e) 73 { 74 GuiAboutDialog.this.dispose(); 75 } 76 } 77 } 78 | Popular Tags |