|
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="">>
|
|
|
|
|
Have a Map with Elements <Key,List<MessageStructure,Score>>.
|
|
|
|
|
Hi,
i want to send message for other node's neighbors in peersim and i write protocol for node to do that for this job i send and receive messages using protocol's send and receive methods. an agent to send a message to her neighbor call put method of neighbor to do that .is it correct or no?
thanks,
it's my code for send and receivemessage.
public void clearinbix()
{
inbox.clear();
}
public void clearoutbox(){
outbox.clear();
}
protected ArrayList<Message> getIncomingMessage()
{
ArrayList<Message> inmsg=(ArrayList<Message>)inbox.clone();
tempMessages.addAll(inmsg);
clearinbix();
return inmsg;
}
public void putMessage(Message msg)
{
inbox.add(msg);
}
protected void sendOutGoingMessage(Message msg,Node node)
{
msg.setSource(node);
outbox.add(msg);
}
public ArrayList<Message> getMessages()
{
ArrayList<Message> outmsg=(ArrayList<Message>)outbox.clone();
clearoutbox();
return outmsg;
}
modified 20-Sep-13 0:18am.
|
|
|
|
|
|
yes i study documentation but there is no example that show this way of message passing is correct or not correct. i want to know my code do message passing though the simulation or i pass message directly between nodes.
thanks,
|
|
|
|
|
Then you need to test your code; we cannot tell you whether it is correct or not.
Veni, vidi, abiit domum
|
|
|
|
|
How can I select the check box and press the submit bottom and only search for the selected check box option.?
|
|
|
|
|
No idea whatsoever, provide a proper explanation of your problem. Also, your title is "Php", so what does this have to do with Java?
Anf finally, please do not put your question in bold, this is considered rude.
Veni, vidi, abiit domum
|
|
|
|
|
Is your question related to java or php?
|
|
|
|