• Post Reply Bookmark Topic Watch Topic
  • New Topic

initialising result

 
camzio Small
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am new to java and having problems using the JOptionPane?
I was wondering why I am being asked to initialise a String? infact even when I initialise the String it quite rightly states this is an int. I cannot see what I have done wrong and can't find any help as to why this is. any help would be much appreciated. Thank you very much

//
public static void main(String[] args)
{
int side1, side2, side3 ;
String side1Str, side2Str, side3Str, result;

side1Str = JOptionPane.showInputDialog("Enter side1");
side1 = Integer.parseInt(side1Str);

side2Str = JOptionPane.showInputDialog("Enter side2");
side2 = Integer.parseInt(side1Str);

side3Str = JOptionPane.showInputDialog("Enter side3");
side3 = Integer.parseInt(side1Str);

if ((side1 > side2) == true)
if((side1 < side3) == true)

result = "That is an isosceles Traingle";
// JOptionPane.showMessageDialog (null, result); // This is the line I am having trouble with//

//
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35719
412
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Camzio,
Welcome to JavaRanch. We have a forum just for Swing/AWT/etc. Since this isn't about JSP, I'll move it for you.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!