Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Where is the JFrame constructor?

Reply
Thread Tools

Where is the JFrame constructor?

 
 
Passero
Guest
Posts: n/a
 
      07-04-2003
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...


 
Reply With Quote
 
 
 
 
Patrick Meuser
Guest
Posts: n/a
 
      07-04-2003
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" <(E-Mail Removed)> wrote in message
news:H7cNa.5665$(E-Mail Removed)-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...
>
>



 
Reply With Quote
 
 
 
 
Wolf Martinus
Guest
Posts: n/a
 
      07-04-2003
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 http://www.velocityreviews.com/forums/(E-Mail Removed) make sure to provide an
interesting subject line.

 
Reply With Quote
 
Passero
Guest
Posts: n/a
 
      07-04-2003

"Wolf Martinus" <(E-Mail Removed)> schreef in bericht
news:be3s1r$gjs$(E-Mail Removed)...
> 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 (E-Mail Removed) make sure to provide an
> interesting subject line.
>



 
Reply With Quote
 
Thomas Kellerer
Guest
Posts: n/a
 
      07-04-2003
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

 
Reply With Quote
 
Ken Ream
Guest
Posts: n/a
 
      07-05-2003

"Passero" <(E-Mail Removed)> wrote in message
news:H7cNa.5665$(E-Mail Removed)-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! =-----
 
Reply With Quote
 
Tassilo Horn
Guest
Posts: n/a
 
      07-05-2003
"Ken Ream" <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How Can I Get One JFrame To Appear Above Another JFrame clusardi2k@aol.com Java 2 08-27-2012 03:01 PM
start a new JFrame from an existing one, and when old JFrame closes new one does not jakester Java 3 04-02-2007 11:13 PM
how to not show a JFrame in taskbar Passero Java 5 07-13-2003 12:38 AM
Re: where is the JFrame constructor Passero Java 2 07-11-2003 11:05 PM
JFrame URL Link René Kikkenborg Java 1 07-09-2003 06:55 AM



Advertisments