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

📄 userdetailsdialog.java

📁 一个类似QQ的在线通讯聊天软件原码,适合初学者参考学习。
💻 JAVA
字号:
package openicq.gui;import java.awt.Dimension;import javax.swing.JFrame;import openicq.Start;import org.javalib.dynamic.localize.Localizable;import org.javalib.gui.model.SettingsDialogModel;import org.javalib.gui.model.SettingsDisplayPanel;import org.javalib.util.TitledList;import JOscarLib.Management.Contact;/** * The <code>UserDetailsDialog</code> class is the basic dialog to view and * change the user details. * @author Hansgeorg Schwibbe * @copyright 2004 */public class UserDetailsDialog extends SettingsDialogModel  implements Localizable{  protected static TitledList localized = Start.env.getLocalizedList();  protected Contact contact;  protected MainFrame mainFrame;  protected UserDetailsOverviewPanel overviewPanel;  protected UserDetailsPanel detailsPanel;  /**   * Initializes a new instance of the class <code>UserDetailsDialog</code>.   * @param parent the parent frame   */  public UserDetailsDialog(JFrame parent)  {    super(parent, ((String[]) localized.get("detailsDialog"))[0], false, 0.25);    mainFrame = (MainFrame) parent;  }  /**   * (non-Javadoc)   * @see org.javalib.gui.model.SettingsDialogModel#action_saveSettings()   */  protected void action_saveSettings()  {    super.action_saveSettings();  }  /**   * Sets the focus on the close button.   */  public void focusCloseButton()  {    super.jButtonClose.requestFocus();  }  /**   * (non-Javadoc)   * @see org.javalib.gui.model.SettingsDialogModel#getCloseButtonText()   */  protected String getCloseButtonText()  {    return ((String[]) localized.get("stdButtons"))[3];  }  /**   * (non-Javadoc)   * @see org.javalib.gui.model.SettingsDialogModel#getDialogSize()   */  protected Dimension getDialogSize()  {    return new Dimension(420, 290);  }  /**   * (non-Javadoc)   * @see org.javalib.gui.model.SettingsDialogModel#getDisplayPanels()   */  protected SettingsDisplayPanel[] getDisplayPanels()  {    overviewPanel = new UserDetailsOverviewPanel(this);    detailsPanel = new UserDetailsPanel(this);    return new SettingsDisplayPanel[]    {     overviewPanel,     detailsPanel    };  }  /**   * (non-Javadoc)   * @see org.javalib.gui.model.SettingsDialogModel#getSelectedIndex()   */  protected int getSelectedIndex()  {    return 0;  }  /**   * (non-Javadoc)   * @see org.javalib.dynamic.localize.Localizable#localize()   */  public void localize()  {    synchronized (Start.env)    {      localized = Start.env.getLocalizedList();      if (this.contact != null)      {        this.setTitle(((String[]) localized.get("detailsDialog"))[0] + ":  "                      + Start.env.getDisplayName(this.contact));      }    }    this.setCloseButtonText(this.getCloseButtonText());    this.setDisplayPanels(this.getDisplayPanels());  }  /**   * Sets the contact of this dialog.   * @param contact the contact of this dialog   */  protected void setContact(Contact contact)  {    this.contact = contact;    this.localize();  }}

⌨️ 快捷键说明

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