Click here to Skip to main content
15,890,282 members
Home / Discussions / Java
   

Java

 
GeneralRe: Using the Observer and Observable Class Pin
angrybobcat7-Oct-13 20:55
angrybobcat7-Oct-13 20:55 
QuestionSVM implementation in JAVA Pin
Member 1030559829-Sep-13 18:07
Member 1030559829-Sep-13 18:07 
AnswerRe: SVM implementation in JAVA Pin
jschell30-Sep-13 8:33
jschell30-Sep-13 8:33 
QuestionGet & Set Pin
Shuvo Sarker29-Sep-13 10:32
professionalShuvo Sarker29-Sep-13 10:32 
AnswerRe: Get & Set Pin
bryce29-Sep-13 13:14
bryce29-Sep-13 13:14 
AnswerRe: Get & Set Pin
Richard MacCutchan29-Sep-13 21:18
mveRichard MacCutchan29-Sep-13 21:18 
AnswerRe: Get & Set Pin
Logical9416-Oct-13 19:07
professionalLogical9416-Oct-13 19:07 
QuestionGetting value from an eventListener? Pin
KatsuneShinsengumi28-Sep-13 3:31
KatsuneShinsengumi28-Sep-13 3:31 
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:

C#
/*If the item1 receives a value of 300 the JOptionPane will display the message Field 1: 300 and if the item2 receives a value of 1000 the JOptionPane will display the message Field 2: 1000 but will happen in different JOptionPane Box once pressed enter*/

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,
AnswerRe: Getting value from an eventListener? Pin
Richard MacCutchan28-Sep-13 6:46
mveRichard MacCutchan28-Sep-13 6:46 
GeneralRe: Getting value from an eventListener? Pin
KatsuneShinsengumi28-Sep-13 18:47
KatsuneShinsengumi28-Sep-13 18:47 
GeneralRe: Getting value from an eventListener? Pin
Richard MacCutchan28-Sep-13 21:19
mveRichard MacCutchan28-Sep-13 21:19 
GeneralRe: Getting value from an eventListener? Pin
KatsuneShinsengumi28-Sep-13 21:26
KatsuneShinsengumi28-Sep-13 21:26 
Questiontell me java code Pin
Member 1030137427-Sep-13 9:30
Member 1030137427-Sep-13 9:30 
AnswerRe: tell me java code Pin
NotPolitcallyCorrect27-Sep-13 9:36
NotPolitcallyCorrect27-Sep-13 9:36 
QuestionNeper number Pin
parisa6821-Sep-13 5:23
parisa6821-Sep-13 5:23 
AnswerRe: Neper number Pin
Richard MacCutchan21-Sep-13 5:56
mveRichard MacCutchan21-Sep-13 5:56 
AnswerRe: Neper number Pin
parisa6821-Sep-13 6:05
parisa6821-Sep-13 6:05 
AnswerRe: Neper number Pin
sep_exambo23-Sep-13 15:40
professionalsep_exambo23-Sep-13 15:40 
Question1) GenK-tree algorithm, 2) algorithm for > > inclusion-exclusion Using JGraphT ( Java Code) Pin
Mithun Suthar20-Sep-13 2:18
Mithun Suthar20-Sep-13 2:18 
AnswerRe: 1) GenK-tree algorithm, 2) algorithm for > > inclusion-exclusion Using JGraphT ( Java Code) Pin
Richard MacCutchan20-Sep-13 3:21
mveRichard MacCutchan20-Sep-13 3:21 
GeneralRe: 1) GenK-tree algorithm, 2) algorithm for > > inclusion-exclusion Using JGraphT ( Java Code) Pin
Mithun Suthar20-Sep-13 5:14
Mithun Suthar20-Sep-13 5:14 
Questionjava collection Pin
parisa6819-Sep-13 21:52
parisa6819-Sep-13 21:52 
AnswerRe: java collection Pin
Richard MacCutchan19-Sep-13 23:21
mveRichard MacCutchan19-Sep-13 23:21 
AnswerRe: java collection Pin
Mohini J.2-Oct-13 3:05
professionalMohini J.2-Oct-13 3:05 
AnswerRe: java collection Pin
Vivek Vermani13-Jan-14 12:01
Vivek Vermani13-Jan-14 12:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.