getContentPane problem

Discussion in 'Java' started by DaveForgotHisEngineering, Mar 4, 2008.

  1. 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() );
    ..........................................................................
     
    DaveForgotHisEngineering, Mar 4, 2008
    #1
    1. Advertising

  2. DaveForgotHisEngineering wrote:
    > 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().

    --

    Knute Johnson
    email s/nospam/knute/

    --
    Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
    ------->>>>>>http://www.NewsDemon.com<<<<<<------
    Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
     
    Knute Johnson, Mar 4, 2008
    #2
    1. Advertising

  3. Thanks!

    On Mar 3, 11:16 pm, Knute Johnson <>
    wrote:
    > DaveForgotHisEngineering wrote:
    > > 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().
    >
    > --
    >
    > Knute Johnson
    > email s/nospam/knute/
    >
    > --
    > Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
    >       ------->>>>>>http://www.NewsDemon.com<<<<<<------
    > Unlimited Access, Anonymous Accounts, Uncensored Broadband Access
     
    DaveForgotHisEngineering, Mar 4, 2008
    #3
  4. DaveForgotHisEngineering

    Roedy Green Guest

    On Mon, 3 Mar 2008 20:42:09 -0800 (PST), DaveForgotHisEngineering
    <> wrote, quoted or indirectly quoted someone who
    said :

    > c = getContentPane();


    That's because there is no Applet.getContentPane.

    Perhaps you meant JApplet.getContentPane.

    Don't mix AWT and Swing components.
    --

    Roedy Green Canadian Mind Products
    The Java Glossary
    http://mindprod.com
     
    Roedy Green, Mar 5, 2008
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andreas Suurkuusk
    Replies:
    0
    Views:
    4,030
    Andreas Suurkuusk
    Jul 27, 2003
  2. Ted Miller
    Replies:
    0
    Views:
    5,218
    Ted Miller
    Sep 13, 2003
  3. RCS
    Replies:
    3
    Views:
    698
  4. Gil
    Replies:
    9
    Views:
    1,742
  5. Mike

    Problem problem problem :( Need Help

    Mike, May 7, 2004, in forum: ASP General
    Replies:
    2
    Views:
    581
    Bullschmidt
    May 11, 2004
Loading...

Share This Page