Julie
Posts: 13
Nickname: champ
Registered: Mar, 2002
|
|
Re: cannot resolve symbol
|
Posted: Apr 22, 2002 7:41 PM
|
|
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); } }
|
|