1 26 package org.objectweb.openccm.explorer.menu; 27 28 import java.awt.BorderLayout ; 29 import java.awt.Color ; 30 import java.awt.Dimension ; 31 import java.awt.Font ; 32 import java.awt.Frame ; 33 import java.awt.GridLayout ; 34 import java.awt.Point ; 35 import java.awt.event.ActionEvent ; 36 import java.awt.event.ActionListener ; 37 38 import javax.swing.Box ; 39 import javax.swing.ImageIcon ; 40 import javax.swing.JButton ; 41 import javax.swing.JDialog ; 42 import javax.swing.JLabel ; 43 import javax.swing.JPanel ; 44 45 53 public class AboutDialog 54 extends JDialog 55 { 56 57 63 69 public AboutDialog(Frame owner){ 70 super(owner, "About OpenCCM Explorer", true); 71 72 JPanel titlePanel = new JPanel (); 73 titlePanel.setBackground(Color.white); 74 75 Box box = Box.createVerticalBox(); 76 box.add(new TitlePanel("OpenCCM", new Font ("TimesRoman", Font.BOLD, 20))); 77 box.add(new TitlePanel("The Open CORBA Component Model Platform", new Font ("TimesRoman", Font.ITALIC, 16))); 78 79 Box imgBox = Box.createHorizontalBox(); 80 imgBox.add(Box.createHorizontalGlue()); 81 imgBox.add(new JLabel (Menu.createIcon("icons/OpenCCM2.png"))); 82 imgBox.add(Box.createHorizontalGlue()); 83 84 box.add(imgBox); 85 box.add(new TitlePanel("Copyright © 1999-2004, ObjectWeb Consortium", new Font ("TimesRoman", Font.ITALIC, 12))); 86 titlePanel.add(box); 87 getContentPane().add(titlePanel,BorderLayout.CENTER); 88 89 JPanel buttonPanel = new JPanel (); 90 buttonPanel.setBackground(Color.white); 91 JButton button = new JButton ("OK"); 92 button.addActionListener(new ActionListener (){ 93 public void actionPerformed(ActionEvent e){ 94 AboutDialog.this.hide(); 95 } 96 }); 97 button.setPreferredSize(new Dimension (100,25)); 98 buttonPanel.add(button); 99 getContentPane().add(buttonPanel,BorderLayout.SOUTH); 100 101 pack(); 102 103 Point p = owner.getLocation(); 105 setLocation(p.x+15, p.y+15); 106 107 } 108 109 115 121 127 class TitlePanel extends JPanel { 128 public TitlePanel(String title, Font f){ 129 setBackground(Color.white); 130 JLabel label = new JLabel (); 131 label.setFont(f); 132 label.setText(title); 133 add(label); 134 } 135 } 136 137 } 138 139 | Popular Tags |