JOptionPane can be used to show some message/info to the user. Static method named showMessageDialog is used for that purpose as shown below:

Java Code:
JOptionPane.showMessageDialog(null, "Temp is: " + temp);