![]() |
| ||
| java and using observable class I need to make my popup class observable and the main frame class observer. When the user clicks the ok button on the popup, I need the string from the popup's textfield returned to my main program. Main fram class.
Popup class.
Also, if anyone could show an example of the above code using a listener class without making it an inner-class, it would be appreciated. Thats the only way my professors taught it, and my degree doesn't have any more java classes scheduled for it. So if you're wondering, no this isn't a homework assignment. |
| ||
| Re: java and using observable class Nobody knows? Haven't found a forum yet that can answer this. |
| ||
| Re: java and using observable class Quote:
Is it a Applet Program or Application Program? If so,How to run this ? Thank You |
| ||
| Re: java and using observable class It's a Swing application, not an Applet, and, I'm sorry, but, if you can't figure out both that, and how to run it, from looking at the code, then I don't think the code is going to do you much good. What do you want it for? |
| ||
| Re: java and using observable class Thanks for your reply Mr.masijade I just wanted to know which file we have to run.. While running, Whether Will it execute in Applet window or in Console...? Thank you |
| ||
| Re: java and using observable class Also I wanted to learn about how to use observer and Observable Thank You |
| ||
| Re: java and using observable class Well, what are the defining methods of an Applet and what is the defining method of a console application. If you can answer that question, then a quick (and I do mean quick) look at the code will tell you which class to run and (at least generally) how to run it. If it is (were) an Applet a little more diggin would be necessary to discover the parameters. |
| ||
| Re: java and using observable class Quote:
Hi Phaelax, I don't think forums can directly help you in this problem. Because you specified you want to add observer and observable to your classes, but you did not even implemented the observer interface correctly. I will recommend you to read how MVC (model/view/controller) pattern works, then you can figure out how to do this. After you are ready with your code, and have any problem, please let us know, we should be able to help you. Here is a good link to learn about MVC: http://csis.pace.edu/~bergin/mvc/mvcgui.html HINTS: to make observer/observable works, you must have to notify observer about the change is made in observable object by calling notifyObserver(); Besides, you must have to write the implementation of update() method. |
| ||
| Re: java and using observable class Quote:
Just to clarify! Java and javascript is not same! If you have previous experience with only javascript or java applets, you should start from beginning in java! |
| All times are GMT -4. The time now is 10:11 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC