Help diagnose a simple problem that is driving me crazy!
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   jason_rangsipat
Posted On:   Monday, April 22, 2002 07:11 AM

Hey guys, i'm a beginner trying to learn JBuilder right now, and i can't seem to get this simple program to execute correctly. Here's the code. -----------------------------begin code package project1; /** * Title: * Description: * Copyright: Copyright (c) 2002 * Company: * @author unascribed * @version 1.0 */ import javax.swing.*; public class Java3 { // i/o using swing String FirstName = JOptionPane.showInputDialog ("Enter your first name"); String str1 = JOptionPane.showInputDialog ("Enter your age"); int age = Integer.parseInt(str1)   More>>

Hey guys, i'm a beginner trying to learn JBuilder right now, and i can't seem to get this simple program to execute correctly. Here's the code.

-----------------------------begin code

package project1;

/**
*

Title:


*

Description:


*

Copyright: Copyright (c) 2002


*

Company:


* @author unascribed
* @version 1.0
*/


import javax.swing.*;


public class Java3 {

// i/o using swing


String FirstName = JOptionPane.showInputDialog

("Enter your first name");

String str1 = JOptionPane.showInputDialog

("Enter your age");

int age = Integer.parseInt(str1);


String msg = "Hi " + FirstName + ", you are


only " + age + " years old!";

JOptionPane.showMessageDialog(null,msg);

System.exit(0);
}
}
------------------------end code


Can any of you advance users lend your wealth of knowledge? Thanks a lot!    <<Less

Re: Help diagnose a simple problem that is driving me crazy!

Posted By:   Anonymous  
Posted On:   Monday, April 22, 2002 07:23 AM

The code is not the problem, it's running fine on my machine... What does it do when you try to run this??
About | Sitemap | Contact