June 2017
Beginner
1296 pages
69h 23m
English
... JOptionPane.PLAIN_MESSAGE);
49 }
50 }
51
52 // retrieve equation from web service and display left side to user
53 private void generateJButtonActionPerformed(
54 java.awt.event.ActionEvent evt)
55 {
56 try
57 {
58 String url = String.format("http://localhost:8080/" +
59 "EquationGeneratorXML/webresources/equation/%s/%d",
60 operation, difficulty);
61
62 // convert XML back to an Equation object
63 Equation equation = JAXB.unmarshal(url, Equation.class);
64
65 answer = equation.getResult();
66 equationJLabel.setText(equation.getLeftHandSide() + " =");
67 checkAnswerJButton.setEnabled(true);
68 }
69 catch (Exception exception)
70 {
71 exception.printStackTrace();
72 }
73 }
74
75 // obtains the mathematical operation selected by the user
76 private void operationJComboBoxItemStateChanged( ...Read now
Unlock full access