File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JFRAME ERROR

 
Rico jamz
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9214
9
Linux Mac OS X Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Humor me. Post the results of "java -version"
 
Rico jamz
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am usuing sun one studios, i am new at java
 
Joe Ess
Bartender
Posts: 9214
9
Linux Mac OS X Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic