not an enclosing class Java

I'm trying to use the timer and use an inner class as the TimerTask. However, I'm getting the error "error: not an enclosing class: FrameTesting.Testing". I'm new to inner classes.

import java.util.*;

public class FrameTesting {

public static void main(String[]args){

Timer timer = new Timer();

timer.schedule(Testing.this, 0, 100);

}

public class Testing extends TimerTask{

public void run(){

}

}

}

The inner class can't be static due to the project I'm working on....

Read More »

By: StackOverFlow - Monday, 5 November

Related Posts