aspose file tools*
The moose likes Beginning Java and the fly likes JFRAME ERROR Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "JFRAME ERROR" Watch "JFRAME ERROR" New topic
Author

JFRAME ERROR

Rico jamz
Greenhorn

Joined: Nov 01, 2003
Posts: 6
hey guys, i need help
this is the part of code that i am getting an error for
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class maxandmin implements ActionListener {

private static final int winwidth = 350;
private static final int winheight = 350;
private static final int field = 20;
private static final int area = 20;

private static FlowLayout layoutstyle = new FlowLayout();
private static JFrame window = new JFrame("Maximum and Minimum");
private static final String legend = "This program find the MAX and MIN of 4 numbers.";
private JTextArea legendarea = new JTextArea (legend, 2, area);

the error says
maxandmin.java [24:1] cannot resolve symbol
symbol : constructor JFrame (java.lang.String)
location: class JFrame
private static JFrame window = new JFrame("Maximum and Minimum");
^
1 error
Errors compiling maxandmin.
could someone help me with this please
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8964
    
    9

Humor me. Post the results of "java -version"


[How To Ask Questions On JavaRanch]
Rico jamz
Greenhorn

Joined: Nov 01, 2003
Posts: 6
i am usuing sun one studios, i am new at java
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8964
    
    9

Originally posted by Rico jamz:
i am usuing sun one studios, i am new at java

Yea, that's why I'm starting slow. "java -version" tells us what version of the JDK you are using. I tried your code with 1.4.1 and it works fine. I'm thinking you have a 1.1.* version somewhere. Of course, you dont get an error that it can't import javax.swing.*, right?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JFRAME ERROR