• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Question about JOptionPane

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Trying to find out how to read in 3 decimal number values add them all together and out a JOptionPane MessageDialog window showing the initial 3 input numbers and the sum answer. Also if it possible to add a button on the JOptionPane Message window to create a text file output of the input numbers and sum answer.
 
Rancher
Posts: 3051
22
 
Billy Briggs
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Quite a few people suggest doing it with JPanel and JTextFields. I was interested to use the program and tried to see if it worked storing inputs into the field variables, but on adding out.println(value1) I get error messae,
JOptionPaneMultipleInput2.java:25: error: cannot find symbol
out.println(value1);
               ^
 symbol:   variable value1
 location: class JOptionPaneMultipleInput2
1 error
 
Billy Briggs
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just remove this query as I have managed to resolve my problems with the program.
 
Marshal
Posts: 64680
225
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It iw probably easier t have three text fields on the main display, then you won't need the dialogue window at all. We don't normally remove threads, but please click the resolved button.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!