从网站中提取Applet的源文件

时间:2013-04-22 19:06:26

标签: java graph web applet

我想查看此Applet

的源文件

我该怎样做才能得到它?

1 个答案:

答案 0 :(得分:2)

页面的源代码是:

<HTML>
<HEAD>
<TITLE>Non-Directed, Non-Weighted Graph</TITLE>
</HEAD>
<BODY>
   <TABLE BORDER UNITS=PIXELS COLSPEC="L330 L250" CELLPADDING=7>
   <CAPTION><STRONG>Lafore's Non-Directed
Non-Weighted Graph</STRONG></CAPTION>
      <TH>Graph
      <TH>Operation
      <TR>
      <TD>
         <APPLET
            CODE=GraphN.class
            WIDTH=440
            HEIGHT=320>
         </APPLET>
    ...
</BODY>
</HTML>

如您所见,Java代码位于http://mainline.brynmawr.edu/Courses/cs206/spring2004/WorkshopApplets/Chap13/GraphN/GraphN.class

  • 点击下面的链接,将文件保存到任何地方。
  • 使用java decompiler查看来源

以下是输出produced by

enter image description here

import java.applet.Applet;
...
import java.util.EventObject;

public class GraphN extends Applet
  implements Runnable, ActionListener, MouseListener
{
  private Thread runner;
  private vertexGroup theVertexGroup;
  private boolean wasClearPressed = false;
  private Button newButton;
  private Button dfsButton;
  private Button bfsButton;
  private Button treeButton;
  private Button viewButton;

  public void init()
  {
    addMouseListener(this);

    setLayout(new FlowLayout());
    Panel localPanel1 = new Panel();
    add(localPanel1);
    localPanel1.setLayout(new FlowLayout());
    ...
  }
}