The Artima Developer Community
Sponsored Link

Java Answers Forum
cannot resolve symbol

3 replies on 1 page. Most recent reply: Apr 22, 2002 7:54 PM by Singh M.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
Julie

Posts: 13
Nickname: champ
Registered: Mar, 2002

cannot resolve symbol Posted: Apr 22, 2002 7:17 PM
Reply to this message Reply
Advertisement
I am unable to run applets and in trying to figure out why I did something to my computer. When I try to run javac on a file setContentPane, setSize and JFrame all come back as cannot resolve symbol. I think I may have done something to autoexec.bat to cause this...but when I revised it to what it was I still come up with these errors. Any help would be greatly appreciated!! thanks


Singh M.

Posts: 154
Nickname: ms
Registered: Mar, 2002

Re: cannot resolve symbol Posted: Apr 22, 2002 7:25 PM
Reply to this message Reply
are you importing the proper packages/classes?

Julie

Posts: 13
Nickname: champ
Registered: Mar, 2002

Re: cannot resolve symbol Posted: Apr 22, 2002 7:41 PM
Reply to this message Reply
I am importing the proper packages...even when I copy a file directly off a web page or from a book...one that has been proven to work...such as this one below..each time I try to create a class using Javac I get "cannot resolve symbol" for JFrame or setContentPane, and setSize.

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

class Alphabet extends JFrame {
JButton a = new JButton("Alibi");
JButton b = new JButton("Burglar");
JButton c = new JButton("Corpse");
JButton d = new JButton("Deadbeat");
JButton e = new JButton("Evidence");
JButton f = new JButton("Fugitive");

Alphabet() {
super("Alphabet");
setSize(360, 120);
JPanel pane = new JPanel();
FlowLayout lm = new FlowLayout(FlowLayout.LEFT);
pane.setLayout(lm);
pane.add(a);
pane.add(b);
pane.add(c);
pane.add(d);
pane.add(e);
pane.add(f);
setContentPane(pane);
}

public static void main(String[] arguments) {
JFrame frame = new Alphabet();
ExitWindow exit = new ExitWindow();
frame.addWindowListener(exit);
frame.show();
}
}

class ExitWindow extends WindowAdapter {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
}

Singh M.

Posts: 154
Nickname: ms
Registered: Mar, 2002

Re: cannot resolve symbol Posted: Apr 22, 2002 7:54 PM
Reply to this message Reply
http://forum.java.sun.com/thread.jsp?forum=7&thread=13446

Flat View: This topic has 3 replies on 1 page
Topic: Arrays vs. Vectors Previous Topic   Next Topic Topic: Counting Different Characters

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use