⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 infodialog.java

📁 一个类似QQ的在线通讯聊天软件原码,适合初学者参考学习。
💻 JAVA
字号:
package openicq.gui;import java.awt.Dimension;import java.awt.Frame;import openicq.Start;import openicq.data.Default;import org.javalib.document.HTML3Document;import org.javalib.dynamic.localize.Localizable;import org.javalib.gui.model.InfoDialogComponent;import org.javalib.gui.model.InfoDialogModel;import org.javalib.util.TitledList;/** * The <code>InfoDialog</code> class contains the info dialog of this * application. * @author Hansgeorg Schwibbe * @copyright 2004 */public class InfoDialog extends InfoDialogModel implements Localizable{  protected static TitledList localized = Start.env.getLocalizedList();  /**   * Initializes a new instance of the class <code>InfoDialog</code>.   * @param owner the owner frame   */  public InfoDialog(Frame owner)  {    super(owner, ((String[]) localized.get("menubar"))[6], false);  }  /**   * (non-Javadoc)   * @see org.javalib.gui.model.InfoDialogModel#getDialogSize()   */  protected Dimension getDialogSize()  {    return new Dimension(400, 300);  }  /**   * (non-Javadoc)   * @see org.javalib.gui.model.InfoDialogModel#getDialogComponents()   */  protected InfoDialogComponent[] getDialogComponents()  {    String text;    HTML3Document versionDoc = new HTML3Document();    text = ((String[]) localized.get("mainFrame"))[0] + " " + Default.VERSION;    versionDoc.printFont(text, "#0000FF", +0, new int[]    {     HTML3Document.CENTERED,     HTML3Document.BOLD    });    text = ((String[]) localized.get("infoDialogTabVersion"))[1] + " "           + Default.AUTHOR;    versionDoc.printText(text, new int[]    { HTML3Document.CENTERED    });    text = ((String[]) localized.get("infoDialogTabVersion"))[2] + " "           + String.valueOf(Default.COPYRIGHT);    versionDoc.printText(text, new int[]    { HTML3Document.CENTERED    });    HTML3Document thanksDoc = new HTML3Document();    if (Default.THANKS_PROJECTS.length > 0)    {      text = ((String[]) localized.get("infoDialogTabThanks"))[1];      thanksDoc.printText(text, new int[]      { HTML3Document.CENTERED      });      for (int index = 0; index < Default.THANKS_PROJECTS.length; index++)      {        text = Default.THANKS_PROJECTS[index];        thanksDoc.printFont(text, "#0000FF", +0, new int[]        {         HTML3Document.CENTERED,         HTML3Document.BOLD        });      }      text = ((String[]) localized.get("infoDialogTabThanks"))[2];      thanksDoc.printText(text, new int[]      { HTML3Document.CENTERED      });      thanksDoc.printBr();    }    if (Default.THANKS_PERSONS.length > 0)    {      text = ((String[]) localized.get("infoDialogTabThanks"))[3];      thanksDoc.printText(text, new int[]      { HTML3Document.CENTERED      });      for (int index = 0; index < Default.THANKS_PERSONS.length; index++)      {        text = Default.THANKS_PERSONS[index];        thanksDoc.printFont(text, "#0000FF", +0, new int[]        {         HTML3Document.CENTERED,         HTML3Document.BOLD        });      }      text = ((String[]) localized.get("infoDialogTabThanks"))[4];      thanksDoc.printText(text, new int[]      { HTML3Document.CENTERED      });    }    HTML3Document licenseDoc = new HTML3Document();    licenseDoc.printFont(Default.LICENSE, "#0000FF", +0, new int[]    {     HTML3Document.CENTERED,     HTML3Document.BOLD    });    licenseDoc.printBr();    licenseDoc.printText(((String[]) localized.get("infoDialogTabLicense"))[1]);    licenseDoc.printBr();    licenseDoc.printBr();    licenseDoc.printText(((String[]) localized.get("infoDialogTabLicense"))[2]);    licenseDoc.printBr();    licenseDoc.printBr();    licenseDoc.printText(((String[]) localized.get("infoDialogTabLicense"))[3]);    String version = ((String[]) localized.get("infoDialogTabVersion"))[0];    String thanks = ((String[]) localized.get("infoDialogTabThanks"))[0];    String license = ((String[]) localized.get("infoDialogTabLicense"))[0];    return new InfoDialogComponent[]    {     new InfoDialogComponent(versionDoc, version),     new InfoDialogComponent(thanksDoc, thanks),     new InfoDialogComponent(licenseDoc, license)    };  }  /**   * (non-Javadoc)   * @see org.javalib.dynamic.localize.Localizable#localize()   */  public void localize()  {    synchronized (Start.env)    {      localized = Start.env.getLocalizedList();      this.setTitle(((String[]) localized.get("menubar"))[6]);    }    this.setDialogComponents(this.getDialogComponents());  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -