I cannont figure out how to add components to my applet gui. I remember doing it with getContentPane(), but whenever i use that i get cannot resolve symbol, however it still is on the java api list. I am just attempting to add a jlabel to the gui, any help would be appreciated. Hers my code:
import java.awt.*;
import java.applet.*;
import javax.swing.*;
public class SubmitProject extends Applet {
public void init() {
JPanel panel = new JPanel();
Container container = new getContentPane();
JLabel companyName = new JLabel("Company Name: ");
panel.add(companyName);
}
public void paint(Graphics g) {
g.drawString("test text", 50, 60 );
}
}
import java.awt.*;
import java.applet.*;
import javax.swing.*;
public class SubmitProject extends Applet {
public void init() {
JPanel panel = new JPanel();
Container container = new getContentPane();
JLabel companyName = new JLabel("Company Name: ");
panel.add(companyName);
}
public void paint(Graphics g) {
g.drawString("test text", 50, 60 );
}
}