File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Can't resolve compiler error message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Can Watch "Can New topic

Can't resolve compiler error message

Ryan Perlman

Joined: Oct 31, 2001
Posts: 23
Please Disregard I figured out the errors of my way.. Thanks Ryan

I have a button that says print: when pushed i want to print my array:
heres is the error message that I get:
Cannot Resolve Symbol:
Symbol: Variable input Location: class FirstArray
Here is my code:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class FirstArray extends JApplet
implements ActionListener
JLabel label = new JLabel("enter Integers's");
JTextField inputText = new JTextField(10);
JTextArea output = new JTextArea(10,15);
JScrollPane sp = new JScrollPane( output );
JButton print = new JButton("Print Array");
int count = 0;

public void init()
Container c = getContentPane();
c.setLayout(new FlowLayout());
print.addActionListener(new display());


public void actionPerformed(ActionEvent e)
int[] input = new int[20];

if ( count < input.length ){
input[count] = Integer.parseInt(inputText.getText());
output.append(Integer.toString(input[count]) + "\n");
showStatus("Please Enter Another Integer");
if( count == input.length){
output.append("Thank You\n" + "Your Done\n\n");
showStatus("Your Done");
private class display implements ActionListener
public void actionPerformed(ActionEvent e)
for(int i = 0; i < input.length; i++){
output = output.append(Integer.toString(input[i]));

[This message has been edited by Ryan Perlman (edited November 15, 2001).]
Wilfried LAURENT
Ranch Hand

Joined: Jul 13, 2001
Posts: 269
Originally posted by Ryan Perlman:


The variable input is local to the method actionPerformed in the class FirstArray. So you can not access it from your local inner class Display. You should make input an instance variable for example.
I agree. Here's the link:
subject: Can't resolve compiler error message
It's not a secret anymore!