How do i set JTextField default to 0 without int error?

here is an exampleconfrenceFees = new JTextField(10);how do i make it default 0 unless the user enters somthing new?if i dosomthing like: confrenceFees.setText(0);i get a compiler error saying not an int
[238 byte] By [PoleVaulta] at [2007-11-27 2:55:59]
# 1
setText() needs a String argument: so you would use "0", not 0.For a more complex solution consider JFormatedTextField. There some code here: http://www.exampledepot.com/egs/javax.swing.text/formtext_FormTextNum.html
pbrockway2a at 2007-7-12 3:33:15 > top of Java-index,Java Essentials,New To Java...
# 2
Bleh... duh thank you...One more quick question.is there a way to take the positive of a negitive number?Exampleaccount = -100how do i get account to print 100?
PoleVaulta at 2007-7-12 3:33:15 > top of Java-index,Java Essentials,New To Java...
# 3

The Math class has a method abs() that does this:int account = -100;

// now account will be 100

account = Math.abs(account);

// or you could use an if statement...

// but I'm sure you have thought of that!

if(account < 0) account = -account;

If you don't want to actually change the value of account - if you just want to print it:System.out.printf("The absolute value of account is %d%n", Math.abs(account));

pbrockway2a at 2007-7-12 3:33:15 > top of Java-index,Java Essentials,New To Java...