简体   繁体   English

Java Applet类文件

[英]Java Applet class file

I am attempting to do my assignment for my Intermediate Java Class. 我正在尝试为中级Java类分配作业。 I am supposed to write this small applet and submit the .java, .class, and .html files. 我应该写这个小程序并提交.java,.class和.html文件。

I went to the .html file to see if what I have written so far would show up on the webpage, but it did now. 我转到.html文件,查看我到目前为止所写的内容是否会显示在网页上,但是现在可以了。 I don't seem to have a .class file. 我似乎没有.class文件。 Here is my code. 这是我的代码。 I am using NetBeans. 我正在使用NetBeans。

Can someone please advise me on how to get the .class file into my folder. 有人可以建议我如何将.class文件放入我的文件夹。

/*
 * Curtis Sizemore
 * IT 259 - Intermediate Java
 * Unit 8
 * Working with Applets
 * I attest that this is a product of my own creation.
 * 
 */
import java.awt.Container;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JApplet;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JTextField;

/**
 *
 * @author Curtis
 */
public class JDivide extends JApplet implements ActionListener
{
JTextField numer = new JTextField();
JTextField denom = new JTextField();
JLabel num = new JLabel("Numerator: ");
JLabel den = new JLabel("Denominator: ");
JLabel result = new JLabel();
JButton solve = new JButton("Click Me to Solve!");
Container con = getContentPane();

@Override
public void init()
{
    con.setLayout(new GridLayout(3,2));
    con.add(num);
    con.add(numer);
    con.add(den);
    con.add(denom);
}


@Override
public void actionPerformed(ActionEvent e) 
{
    throw new UnsupportedOperationException("Not supported yet.");
}

}

The .class file is produced by compiling your .java file. .class文件是通过编译.java文件生成的。 When you compile and run the project in NetBeans, the .class files are created and stored in some folder within your project's directory, probably called "bin" or something like that. 在NetBeans中编译和运行项目时,将创建.class文件并将其存储在项目目录中的某个文件夹中,该文件夹可能称为“ bin”或类似名称。

Try searching your project directory for anything named *.class and see what you find. 尝试在项目目录中搜索名为* .class的任何内容,然后查看发现的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM