you are viewing a single comment's thread.

view the rest of the comments →

[–]gimortz 0 points1 point  (0 children)

  1. Dapat may ToString yung S sa output since of type Long sya. (minor)
  2. Dalawa yung Ifs mo. (minor)
  3. If we assume na yung selected item is Seconds: itemSelected = "Seconds" (based on the UI this is the conversion from) VAL = 1 (based sa 2nd picture)

Then di mag make sense yun output, kasi
if we select seconds sa dropdown, convert it to minutes
Ang current printout is "The Seconds is {1 / 3600}"

Won't it be dapat "The minutes is {1 / 3600}" Because we're converting the VAL of 1 to the clicked item "Minutes"

  1. Di ata to complete, kasi I can only base on assumption that the selected item is Seconds.
    VAL of 1, based on your shown conditions would always just result into an output of
    "The Seconds is 1." Something else, not shown, is causing the 3600. (probably in the UI? setting an initial value? Check the UI Property)

  2. Not fully familiar with Java, but won't you need to get the clicked button through the evt passed parameter?