Where is the JFrame constructor?

Discussion in 'Java' started by Passero, Jul 4, 2003.

  1. Passero

    Passero Guest

    JFrame has a constructor with a String parameter right? Not on my pc... I'm
    using the JDK SE 1.4.2 and i always get the error: the constructor
    JFrame(string)
    is undefined. (i'm using ecclipse).

    public class myFrame extends JFrame
    {
    public myFrame()
    {
    super("myTitle");
    }
    }

    that's it...
     
    Passero, Jul 4, 2003
    #1
    1. Advertising

  2. I don't know what ecclipse is unless you're referring to astronomy. How is
    your classpath set? Maybe try a vanilla configuration of this environment
    variable first, then add your paths until you get the error. Then maybe try
    a different order. I've encountered numerous problems similiar to this
    related to the compiler and its usually either an unreported error in the
    code or a conflict in the classpath..

    Patrick
    "Passero" <> wrote in message
    news:H7cNa.5665$-ops.be...
    > JFrame has a constructor with a String parameter right? Not on my pc...

    I'm
    > using the JDK SE 1.4.2 and i always get the error: the constructor
    > JFrame(string)
    > is undefined. (i'm using ecclipse).
    >
    > public class myFrame extends JFrame
    > {
    > public myFrame()
    > {
    > super("myTitle");
    > }
    > }
    >
    > that's it...
    >
    >
     
    Patrick Meuser, Jul 4, 2003
    #2
    1. Advertising

  3. Passero wrote:
    > JFrame has a constructor with a String parameter right? Not on my pc... I'm
    > using the JDK SE 1.4.2 and i always get the error: the constructor
    > JFrame(string)
    > is undefined. (i'm using ecclipse).


    just a guess:

    forgot the "import javax.swing.JFrame;" ?

    BTW: Eclipse can auto-generate imports when you use the code completion.

    Wolf



    --
    For a private reply to make sure to provide an
    interesting subject line.
     
    Wolf Martinus, Jul 4, 2003
    #3
  4. Passero

    Passero Guest

    "Wolf Martinus" <> schreef in bericht
    news:be3s1r$gjs$...
    > Passero wrote:
    > > JFrame has a constructor with a String parameter right? Not on my pc...

    I'm
    > > using the JDK SE 1.4.2 and i always get the error: the constructor
    > > JFrame(string)
    > > is undefined. (i'm using ecclipse).

    >
    > just a guess:
    >
    > forgot the "import javax.swing.JFrame;" ?


    I tried it in different IDE's: JCreator, sun one studio, all the same error.
    I'm using import javax.swing.*; so that will cover the JFrame right? The
    problem is that he does know the JFrame but he doesn't know the constructor
    with the parameter String. The only constructor he knows for the JFrame is
    that one with no parameters, that's so strange about it.

    > BTW: Eclipse can auto-generate imports when you use the code completion.
    >
    > Wolf
    >
    >
    >
    > --
    > For a private reply to make sure to provide an
    > interesting subject line.
    >
     
    Passero, Jul 4, 2003
    #4
  5. Passero schrieb:
    > JFrame has a constructor with a String parameter right? Not on my pc... I'm
    > using the JDK SE 1.4.2 and i always get the error: the constructor
    > JFrame(string)
    > is undefined. (i'm using ecclipse).
    >
    > public class myFrame extends JFrame
    > {
    > public myFrame()
    > {
    > super("myTitle");
    > }
    > }
    >
    > that's it...
    >
    >

    The following compiles without any problems here with JDK 1.4.2


    import javax.swing.*;

    public class myFrame extends JFrame
    {
    public myFrame()
    {
    super("myTitle");
    }
    }

    There must be someting wrong with your IDE configurations. Did you try
    to compile the file "by hand" on the command line?

    Thomas
     
    Thomas Kellerer, Jul 4, 2003
    #5
  6. Passero

    Ken Ream Guest

    "Passero" <> wrote in message
    news:H7cNa.5665$-ops.be...
    > JFrame has a constructor with a String parameter right? Not on my pc...

    I'm
    > using the JDK SE 1.4.2 and i always get the error: the constructor
    > JFrame(string)
    > is undefined. (i'm using ecclipse).
    >
    > public class myFrame extends JFrame
    > {
    > public myFrame()
    > {
    > super("myTitle");
    > }
    > }
    >
    > that's it...



    In Eclipse, try high-lighting "JFrame" and hitting F3. If you have things
    set
    up right that will open the source for JFrame in your editor (I think its
    read only
    when it does that for a core class, but don't change anything to be safe).
    That
    might help you see what's going on.

    Another thought/suggestion - Eclipse sticks a jdk somewhere in its directory
    structure.
    But I found it was missing something and installed a full JDK elsewhere,
    then changed
    preferences in Eclipse to use that JDK. If you do that, check that your
    classpath and path
    env variables poit to the right places.




    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    -----== Over 80,000 Newsgroups - 16 Different Servers! =-----
     
    Ken Ream, Jul 5, 2003
    #6
  7. Passero

    Tassilo Horn Guest

    Eclipse getting source of JDK classes WAS: Where is the JFrameconstructor?

    "Ken Ream" <> writes:

    > In Eclipse, try high-lighting "JFrame" and hitting F3. If you have things
    > set
    > up right that will open the source for JFrame in your editor (I think its
    > read only
    > when it does that for a core class, but don't change anything to be safe).
    > That
    > might help you see what's going on.


    Hi.
    When I highlight a JDK-class and hit return I get
    "Source not found"
    "The source attachment does not contain the source for the file
    Thread.class."
    "You can change the source attachment by clicking Change Addached Source
    below:"

    Than that button, and below that, there are the fields and methods of
    that class listed, but without any comments.

    What must I do to get there either the corresponding JavaDoc page or
    the real source of the class (better)???

    I'm using Gentoo/GNU Linux with blackdown-jdk-1.4.1 and Eclipse 2.1.

    Greetings and thanks,

    Tassilo
     
    Tassilo Horn, Jul 5, 2003
    #7
    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. Passero
    Replies:
    2
    Views:
    415
    Roedy Green
    Jul 12, 2003
  2. Martijn Mulder
    Replies:
    4
    Views:
    623
    Thomas Hawtin
    Feb 13, 2006
  3. jakester
    Replies:
    3
    Views:
    1,878
    jakester
    Apr 3, 2007
  4. Generic Usenet Account
    Replies:
    10
    Views:
    2,320
  5. Replies:
    2
    Views:
    433
    markspace
    Aug 27, 2012
Loading...

Share This Page