Solved

listeners in Java

Posted on 2012-03-14
3
184 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:gurvinder372
Comment Utility
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
Comment Utility
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:
gurvinder372 earned 500 total points
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now