1 19 20 package taskblocks.app; 21 22 import java.awt.Component ; 23 import java.awt.Font ; 24 25 import javax.swing.Box ; 26 import javax.swing.JDialog ; 27 import javax.swing.JLabel ; 28 import javax.swing.JOptionPane ; 29 import javax.swing.SwingConstants ; 30 import javax.swing.border.EmptyBorder ; 31 32 public class AboutDialog { 33 public static void showAbout(Component parent) { 34 35 Box b = Box.createVerticalBox(); 36 Box b2 = Box.createHorizontalBox(); 37 JLabel l3 = new JLabel (); 38 JLabel l1 = new JLabel ("<html><h2>Task Blocks</h2>Version " + Version.VERSION); 39 JLabel l2 = new JLabel ( 40 "<html><br>" 41 + "<center>Copyright \u00A9 2007 Jakub Neubauer<br>" 42 +"<http://taskblocks.googlecode.com>" 43 +"</center><br>" 44 ); 45 l3.setIcon(TaskBlocks.getImage("taskblocks.png")); 46 l1.setIconTextGap(30); 47 l1.setHorizontalTextPosition(SwingConstants.LEFT); 48 l1.setFont(l1.getFont().deriveFont(Font.PLAIN)); 49 l2.setFont(l2.getFont().deriveFont(Font.PLAIN)); 50 b2.add(l1); 51 b2.add(l3); 52 b.add(b2); 53 b.add(l2); 54 l3.setBorder(new EmptyBorder (0,0,0,20)); 55 56 l1.setAlignmentX(0f); 57 l2.setAlignmentX(0f); 58 l3.setAlignmentX(0f); 59 b2.setAlignmentX(0f); 60 61 JOptionPane op = new JOptionPane (b); 62 JDialog d = op.createDialog(parent, "About"); 63 d.setVisible(true); 64 } 65 66 public static void main(String [] args) { 67 AboutDialog.showAbout(null); 68 } 69 } 70 | Popular Tags |