I am attempting to do my assignment for my Intermediate Java Class. I am supposed to write this small applet and submit the .java, .class, and .html files.
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. I don’t seem to have a .class file. Here is my code. I am using NetBeans.
Can someone please advise me on how to get the .class file into my folder.
/*
* 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. 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.
Try searching your project directory for anything named *.class and see what you find.