getContentPane problem

  • Thread starter DaveForgotHisEngineering
  • Start date
D

DaveForgotHisEngineering

Hi. Thanks in advance for any assistance you can provide. Why isn't
netBeans able to resolve the method getContentPane in the following
line of code: c = getContentPane();


import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.math.*;
import java.util.*;
import java.io.*;
import java.lang.*;

public class ScubaFormulaApplet extends java.applet.Applet implements
ActionListener {
private javax.swing.JPanel jPanel2;
private javax.swing.JLabel jLabel2;
private javax.swing.JTextField jTextField1;
private javax.swing.JLabel jLabel3;
private javax.swing.JTextField jTextField2;
private javax.swing.JLabel jLabel4;
private javax.swing.JTextField jTextField3;
private javax.swing.JLabel jLabel5;
private javax.swing.JTextField jTextField4;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JTextArea resultArea;
private java.awt.Container c;


/** Initialization method that will be called after the applet is
loaded
* into the browser.
*/
public void init() {
initComponents();
setSize(400, 100);
}

private void initComponents() {
c = getContentPane();

c.setLayout( new BorderLayout() );
..........................................................................
 
K

Knute Johnson

DaveForgotHisEngineering said:
Hi. Thanks in advance for any assistance you can provide. Why isn't
netBeans able to resolve the method getContentPane in the following
line of code: c = getContentPane();

Because Applets don't have the method getContentPane().
 
R

Roedy Green

c = getContentPane();

That's because there is no Applet.getContentPane.

Perhaps you meant JApplet.getContentPane.

Don't mix AWT and Swing components.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top