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

📄 backfromthedead.java

📁 learning java的源代码。书中每个实例都有相关的代码example。
💻 JAVA
字号:
//file: BackFromTheDead.javaimport java.awt.Component;import javax.swing.*;import java.beans.*;public class BackFromTheDead extends JFrame {  public BackFromTheDead(  ) {    super("Revived Beans!");    try {      Object bean = Beans.instantiate(        getClass().getClassLoader(  ), "tipcalc" );      if ( Beans.isInstanceOf(bean, Component.class) ) {        Component comp = (Component)          Beans.getInstanceOf(bean, Component.class);        getContentPane(  ).add("Center", comp);      } else {          System.out.println("Bean is not a Component...");      }    }    catch ( java.io.IOException e1 ) {      System.out.println("Error loading the serialized object");    }    catch ( ClassNotFoundException e2 ) {      System.out.println(         "Can't find the class that goes with the object");    }  }  public static void main(String [] args) {    JFrame f = new BackFromTheDead(  );    f.pack(  );    f.setVisible(true);  }}

⌨️ 快捷键说明

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