|
few things that you have to know. Role of the Observer is to notify each subscriber if any changes happen.
If you see in your code there is a recursive call exist. In your main class , at the end, you are setting value in Observer. So Observer value changed and it convey the notify message to the subscriber.Again If you see in doAction() ,you can see that each Subscriber receive the notify message and again set the Observer value with new one. There for this action again update the Observer value and again Observer doing the above thing and thus fall in recursive call.
Regards
Shubhashish
|
|
|
|
|
Where "Observer" is actually "Observable" as you got it right in your first post, since "Observer" and "Subscriber" are basically the same thing.
|
|
|
|
|
Hi,
I want to implement SVM in Java. I have implemented svm in Matlab before but I am new to Java and I found a library LIBSVM which I can use. Is there any other library that I could use?
Thanks
|
|
|
|
|
Presumably what you want is to USE it in your code rather than "implement" (code yourself).
In that case google is the place to start.
|
|
|
|
|
What are the basic deferences between Get & Set methods in Java?
|
|
|
|
|
this sounds like homework questions to me
MCAD
---
|
|
|
|
|
The same as they are in any language, and a read of the documantation or a search[^] would easily find the answer for you.
Veni, vidi, abiit domum
|
|
|
|
|
In Java, one typically tries to avoid having all data structures set as public.
So if it is set to private, getters are a way to access that data value, as the variable may be private, but the getter is public.
Same with setters, if you are trying to modify the value of the variable through another class, and if the variable is private to one class, then a public setter method can modify that value effectively.
|
|
|
|
|
Hey guys,
I'm trying to learn java and I've got stuck on this problem.
I made a program with GUI that when I input on a text field and press enter it will display the value that was entered on a separate JOptionPane dialog box.
I'm trying to combine 2 inputs before displaying them but I cant find the code that will do the trick, here is the code I think I need to change:
if (eventHand.getSource()==item1)
string = String.format("Field 1: %s",eventHand.getActionCommand());
if (eventHand.getSource()==item2)
string = String.format("Field 2: %s",eventHand.getActionCommand());
JOptionPane.showMessageDialog(null,"" +string);
the value is stored on the variable named string, I'm looking for a way store the 2 value on each variable first then display it on the same messagebox.
Thanks,
|
|
|
|
|
Something like:
if (eventHand.getSource()==item1) {
string.concat("Field 1: ");
string.concat(eventHand.getActionCommand());
string.concat(", Field 2: ");
string.concat(item2.Text);
}
if (eventHand.getSource()==item2) {
string.concat("Field 1: ");
string.concat(item1.Text);
string.concat(", Field 2: ");
string.concat(eventHand.getActionCommand());
}
JOptionPane.showMessageDialog(null, string);
Veni, vidi, abiit domum
|
|
|
|
|
Hi,
"Text" part of this (item2.Text); is not working but I think I can handle this already.
also adding a dedicated button also helps me to think it in an organized way.
Thanks,
|
|
|
|
|
KatsuneShinsengumi wrote: "Text" part of this (item2.Text); Since I did not know what type of object item2 was, I had to make a guess.
Veni, vidi, abiit domum
|
|
|
|
|
Yeah thanks, no problem there,.
|
|
|
|
|
1) GenK-tree algorithm,
2) algorithm for inclusion-exclusion principle.
how to implement these two algorithms using JGraphT (java language).
plz help me...
|
|
|
|
|
|
hi,
how can i generate or use neper number in java.
i want to write a function that do uniform distribution.
thanks,
|
|
|
|
|
|
thanks,
|
|
|
|
|
|
Hi Expert,
Can any 1 Help me how to develop the given algorithm in Java using JgraphT
1) GenK-tree algorithm
2) inclusion-exclusion algorithm
I need help regarding develop these above algorithm in Java with code and any tutorial or any same project or algorithm in Java so i can help from then and complete the above task
For reference follow the below link
1) http://jgrapht.org/[^]
2) http://jgrapht.org/visualizations.html[^]
Please help me to develop the application like above reference in Java
Thanks & Regards,
Mithun
mit_pnch86@yahoo.in
|
|
|
|
|
|
Sorry...
but this is my first post in CodeProject but next time i will be careful with your Forum.....
Thanks,
Mithun
|
|
|
|
|
i want to save a message structure and it's score to a data structure. but some of data structures are repetitious.i want to use two dimensional collection with duplicate key which collection can help me?
thanks,
|
|
|
|
|
It's difficult to know which one is best for you, but the Collections tutorial[^] has some good information.
Veni, vidi, abiit domum
|
|
|
|
|
To solve this you can map to every message ID as key to a list of values.
Like : Map<string, list<string="">>
|
|
|
|