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

📄 addressbookdemo.java

📁 现在在国外大学里最流行的java学习软件,同时还有大量的example,在名为project的文件里.安装好后用bluej打开peoject的例子,可以进行你想要的任何变化.同时可以了解大量的源码
💻 JAVA
字号:
/** * Provide a simple demonstration of the AddressBook class. * Sample data is added to the address book, * and a GUI view is provided. *  * @author David J. Barnes and Michael Kolling. * @version 2006.03.30 */public class AddressBookDemo{    private AddressBook book;    private AddressBookGUI interact;    /**     * Setup an AddressBook with sample data.     * The address book is passed to a GUI to provide     * a view of the data.     */    public AddressBookDemo()    {        ContactDetails[] sampleDetails = {            new ContactDetails("david",   "08459 100000", "address 1"),            new ContactDetails("michael", "08459 200000", "address 2"),            new ContactDetails("john",    "08459 300000", "address 3"),            new ContactDetails("helen",   "08459 400000", "address 4"),            new ContactDetails("emma",    "08459 500000", "address 5"),            new ContactDetails("kate",    "08459 600000", "address 6"),            new ContactDetails("chris",   "08459 700000", "address 7"),            new ContactDetails("ruth",    "08459 800000", "address 8"),        };        book = new AddressBook();        for(ContactDetails details : sampleDetails) {            book.addDetails(details);        }        // Provide a GUI view of the address book.        interact = new AddressBookGUI(book);    }    /**     * Allow the user to interact with the address book.     */    public void showInterface()    {        interact.setVisible(true);    }    /**     * @return The sample address book.     */    public AddressBook getBook()    {        return book;    }}

⌨️ 快捷键说明

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