1 package hero.client.grapheditor; 2 3 import java.awt.BorderLayout ; 4 import java.net.URL ; 5 6 import javax.swing.JEditorPane ; 7 import javax.swing.JFrame ; 8 9 public class Info extends JFrame { 10 11 static java.util.ResourceBundle resource = java.util.ResourceBundle.getBundle("resources.Traduction"); 12 13 private static Info INSTANCE = new Info(); 14 15 private Info() { 16 super(resource.getString("info.about")); 17 setSize(276, 322); 18 setResizable(false); 19 setIconImage(Frame.getFrame().getIconImage()); 20 JEditorPane html = new JEditorPane (); 21 html.setEditable(false); 22 html.setContentType("text/html"); 23 URL url = Thread.currentThread().getContextClassLoader().getResource(Frame.imageBase + "logo.png"); 24 html.setText( 25 "<html><body background='" 26 + url 27 + resource.getString("info.html")); 28 getContentPane().add(html, BorderLayout.CENTER); 29 } 30 31 public static void showInfo() { 32 INSTANCE.setLocation( 33 ((Frame.getFrame().getWidth() - INSTANCE.getWidth()) / 2) + Frame.getFrame().getX(), 34 ((Frame.getFrame().getHeight() - INSTANCE.getHeight()) / 2) + Frame.getFrame().getY()); 35 INSTANCE.setVisible(true); 36 } 37 38 } 39 | Popular Tags |