aspose file tools*
The moose likes Java in General and the fly likes object problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "object problem" Watch "object problem" New topic
Author

object problem

narasimharao konjeti
Ranch Hand

Joined: Apr 26, 2003
Posts: 130
hello, I have one singleton class,in that main class, i instantiated one class A , object is "a" , i have to access the method of the class A without using object name "a" through my entire module in other classes. how can i do it? MY class "A" is log file.

waiting for reply.
regards


"Unwise to sweat petty stuff, wise to pet sweaty stuff."
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1873
Hi
Please post your code if you can. The question remains unclear to me, so it would be great if you can try explain in little more details.
Regards
Maulin
narasimharao konjeti
Ranch Hand

Joined: Apr 26, 2003
Posts: 130
hi, for the clear question, just open microsoft word/acces/excel. there is one menu called "help", for that there is one menu item called "what is this?". I have to implement the functionality like that in my desktop application. how can i do it. here in my application i can popup message like access/word. or i can disable the functionality of mouse left button. So please tell, how to popup a message,, or else how to disable the functionality of mouse left button. I am using swings for my desktop
regards
narasimharao konjeti
Ranch Hand

Joined: Apr 26, 2003
Posts: 130
i am sorry forthe above description.
that is another forum question.
i am sorry
narasimharao konjeti
Ranch Hand

Joined: Apr 26, 2003
Posts: 130
my problem is, i want to create on object to write the messages in file. that object should be available for the entire application. to write log messages
thankd
nr konjeti
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1824

It sounds like you need to implement the Singleton pattern. Below is a generalized example:

Now, anywhere you want to access this instance of A, you simply call A.getInstance().
Hope this helps,


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: object problem