KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > hero > client > grapheditor > Info


1 package hero.client.grapheditor;
2
3 import java.awt.BorderLayout JavaDoc;
4 import java.net.URL JavaDoc;
5
6 import javax.swing.JEditorPane JavaDoc;
7 import javax.swing.JFrame JavaDoc;
8
9 public class Info extends JFrame JavaDoc {
10
11 static java.util.ResourceBundle JavaDoc resource = java.util.ResourceBundle.getBundle("resources.Traduction")/*#BundleType=List*/;
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 JavaDoc html = new JEditorPane JavaDoc();
21         html.setEditable(false);
22         html.setContentType("text/html");
23         URL JavaDoc 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