Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
listeners
- Page 1
Listeners
Programming
Software Development
19 Years Ago
by Black Knight
… is another way i havent thought of that doesnt use
listeners
let me know, I dont really want to have to…
Re: listeners
Programming
Software Development
13 Years Ago
by NormR1
… Event, it looks in its list of
listeners
for Action Events and calls any
listeners
in the list. The posted code passes…
Re: listeners
Programming
Software Development
13 Years Ago
by sanjurm16
… a new instance of actionapplet and registers it as the
listeners
. now this is syntactically and semantically right because the addListener…
Re: listeners
Programming
Software Development
13 Years Ago
by NormR1
[QUOTE] in case of applets[/QUOTE] It has nothing to do with the code being an applet. The way to use Action
Listeners
is the same for any class.
Re: Listeners
Programming
Software Development
19 Years Ago
by Phaelax
I think you need to look at the Observer class. I'm not entirely sure how to use it, but it sounds like thats what you need.
Re: Listeners
Programming
Software Development
19 Years Ago
by paradox814
why don't you make a method which assigns true instead of just declaring loggedIn = true; in other words [code]loggedIn = setTrue(); public boolean setTrue() { //do some stuff when the variable is set true here! return true; }[/code]
Re: Listeners
Programming
Software Development
19 Years Ago
by server_crash
I don't think you would have to use loops to continously check to see if it's true. I think you could just use some simple if statements or something simple to check if it's true. Paradox has a neat solution to it..Have a method that makes it true, and also can perform any other task you want if the boolean is true. If it were me, I would go …
Re: Listeners
Programming
Software Development
19 Years Ago
by Black Knight
i already have the set and get methods, the problem is the true bool is an attrib of the gui and you cant return values from a gui. so an if statement wouldnt work either, i need the main thread to watch the awt thread for the bool change and then shut down that gui and start another one. I think Phaelax was hitting nearer the mark with the …
Re: Listeners
Programming
Software Development
19 Years Ago
by paradox814
ahhh... it's a gui component, well then just implement the appropiate listener. You should have said this from the beggining it's kind of hard to guess what you are doing. What component are you using? I will show you how to implement the appropiate listener if you do not know how to.
Re: Listeners
Programming
Software Development
19 Years Ago
by jwenting
Your component can fire for example a PropertyChangedEvent and your other class register itself with the component as a PropertyChangeListener (or whatever it's called). Needs a bit of code, but I'm sure most decent books and the Java tutorial have ample examples.
Re: Listeners
Programming
Software Development
19 Years Ago
by Black Knight
well in i want the main thread to basically wath the gui it creates and as soon as the bool in the gui flips to true i want it to dispose of the log in window and open the main app window, i have tried to implement propertychangelisteners and changelisteners etc... to no avail, i did have it creating the main window through the login listener but …
Re: Listeners
Programming
Software Development
19 Years Ago
by Black Knight
I think i will look further into propertychangeevents
fireEvent() and custom Listeners
Programming
Software Development
14 Years Ago
by peter_budo
… void removeCountListener(CountListener c){ if(
listeners
.contains(c)){
listeners
.remove(
listeners
.indexOf(c)); } } public …catch(Exception e){ } } } } } public CountTest(){
listeners
= new ArrayList(); } public void count(int i){ fireEvent…
Re: fireEvent() and custom Listeners
Programming
Software Development
14 Years Ago
by JamesCherrill
… the standard pattern: [CODE]ArrayList<CountListener>
listeners
= new ... ... void fireCountEvent(int count) { for (CountListener … . countEvent(count); } } ... void fireMultiplyEvent(int mult) { for (CountListener cl :
listeners
) { cl . multiplyEvent(mult); } } public void count(int count) { ... fireCountEvent(…
Re: fireEvent() and custom Listeners
Programming
Software Development
14 Years Ago
by JamesCherrill
…'s a danger of a problem if the list of
Listeners
is updated while the fireEvent code is looping through it…]ArrayList<CountListener> safeCopy = new ArrayList<CountListener>(
listeners
); for (CountListener cl : safeCopy ) { cl . countEvent(count); }[/CODE…
Re: fireEvent() and custom Listeners
Programming
Software Development
14 Years Ago
by kvprajapati
…ArrayList<CountListener> safeCopy = new ArrayList<CountListener>(
listeners
); for(CountListener c:safeCopy) { if(c!=null) c.countEvent(…ArrayList<CountListener> safeCopy = new ArrayList<CountListener>(
listeners
); for(CountListener c:safeCopy) { if(c!=null) c.countEvent(…
Re: fireEvent() and custom Listeners
Programming
Software Development
14 Years Ago
by JamesCherrill
I like the solution with a custom event class to carry the info to the
listeners
. Very nice. Particularly good if there is any chance that there will be more functionality added later, because you can add more event sub-types without changing the formal definition of the listener interface and thus invalidating existing code.
Re: Linking JButtons to key events through Key Listeners.
Programming
Software Development
16 Years Ago
by Ezzaral
You don't show how you are attaching the
listeners
, but yes, it's a focus issue. The easiest thing …for you to do is define the actions for those
listeners
as small inner classes that extend [URL="http://java…"]AbstractAction[/URL]. That will allow the button and key
listeners
to share the code for that action. For the buttons…
Multiple Action Listeners
Programming
Software Development
14 Years Ago
by geek_till_itMHZ
I need to make multiple action
listeners
for 4 radio buttons and a regular button. They all … NOT WORKING, IS THERE ANOTHER WAY OF WRITING MULTIPLE ACTION
LISTENERS
OR DID I MAKE A SYNTAX ERROR [CODE] private void…
Re: Linking JButtons to key events through Key Listeners.
Programming
Software Development
16 Years Ago
by JoePie
….SOUTH); // Add panel to layout. // Add action
listeners
. btnMiddleC.addActionListener(new CButton()); btnMiddleD.addActionListener(new DButton()); //… Add key
listeners
. btnMiddleC.addKeyListener(new CButton()); btnMiddleD.addKeyListener(new DButton()); }…
Re: Multiple Action Listeners
Programming
Software Development
14 Years Ago
by geek_till_itMHZ
its not the deal hand method because when I just had a single action listener done something like [CODE]dealbutton.addActionListener(this);..... ..... public void actionPerformed(ActionEvent e) { dealHand(); }[/CODE] everything worked fine but now that I need multiple action
listeners
for my radio buttons im havin issues
add event listeners for dynamic list of objects
Programming
Web Development
16 Years Ago
by scottholmes
… <div>. An id is necessary for all event
listeners
I've seen so my question is what is a…
Re: add event listeners for dynamic list of objects
Programming
Web Development
16 Years Ago
by scottholmes
… not encode event handlers in display code, instead set up
listeners
. In this case each element in an array of records…
Linking JButtons to key events through Key Listeners.
Programming
Software Development
16 Years Ago
by JoePie
… for a prototype. So far I've implemented my key
listeners
and properly and when I hit 'c' on my keyboard…
Design Question - Listeners
Programming
Software Development
14 Years Ago
by BestJewSinceJC
… Observer pattern. Basically a model had a List of interested
Listeners
. When the model changed, it went through a for loop…
list of event types for listeners?
Programming
Web Development
14 Years Ago
by Ghodmode
… lists of event types that I can attach/add event
listeners
to. I've been searching around and I've found…
Can't set event listeners to multiple elements of same class
Programming
Web Development
14 Years Ago
by zvn
Hi. I'm trying to add event
listeners
to multiple elements of the same class. The DOM is …
Error configuring application listener of class listeners.ContextListener
Programming
Web Development
14 Years Ago
by bharat_van
… i am getting error .::Error configuring application listener of class
listeners
.ContextListener.. what should i do, anything need to configure...my…
What's wrong with this method or what's wrong with my listeners?
Programming
Software Development
13 Years Ago
by mangopearapples
…'t know whether it's my method RestoreScreen() or my
listeners
. This is my code: [code]import javax.swing.*; import java…
Unable to handle user interaction with listeners
Programming
Software Development
11 Years Ago
by 03hasnam
… model, EventView view){ this.model = model; this.view = view; //... Add
listeners
to the view. view.addEventListener(new addEventListener()); view.addDialogListener(new…
1
2
3
17
Next
Last
Search
Search
Forum Categories
Hardware/Software
Programming
Digital Media
Community Center
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Forums
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2024 DaniWeb® LLC