Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

listeners in Java

Posted on 2012-03-14
3
Medium Priority
?
193 Views
Last Modified: 2013-11-24
I have done much ActionScript3 before and it uses listeners to detect some condition. Java has been around longer so I expect this is simialr.

If I want to for example put a whole lot of data into an array in class, and then I want something to tell me when this is done in the 'main' , I use a 'lisetner'.

Hw do I code for this.
0
Comment
Question by:jagguy
  • 2
3 Comments
 
LVL 40

Expert Comment

by:Gurvinder Pal Singh
ID: 37723743
You need to understand first the event handling in Java.
http://www.scoug.com/os24u/1999/scoug905.2.javaevents.html
0
 

Author Comment

by:jagguy
ID: 37723821
I really need a complete example as i didnt follow that.

just say i make a call to a procedure to fill an array with a lot of data. i want a listener to tel me when the array has finished filling
0
 
LVL 40

Accepted Solution

by:
Gurvinder Pal Singh earned 2000 total points
ID: 37723853
A complete example of your requirement will take some time and effort to complete, I'm not able to get the same from internet.
Basically, you need to generate an event when array filling is finished, and add a subscriber to that event so that once that event is completed, subscriber will be notified for the same.
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question