Getting input from textbox

Hi I have written a standalone app;

which gets numerical input from 2 textboxes,

coverts the numbers to strings when a button is pressed.

My problem if the user leaves the space blank i want to create a warning dialog

which prompts the user to enter a number and i would also like to prevent letters from being entered.

I have looked around the net and have used a few ideas but it doesn't work and throws a null pointer exception.

[479 byte] By [TheRidgea] at [2007-11-27 7:28:34]
# 1
Code or it didn't happen
kirillga at 2007-7-12 19:08:42 > top of Java-index,Desktop,Core GUI APIs...
# 2

> Hi I have written a standalone app;

>

> which gets numerical input from 2 textboxes,

> coverts the numbers to strings when a button is

> pressed.

> My problem if the user leaves the space blank i want

> to create a warning dialog

> which prompts the user to enter a number and i would

Take a look at JOptionPane.

> also like to prevent letters from being entered.

>

Take a look at JFormattedTextField.

>

> I have looked around the net and have used a few

> ideas but it doesn't work and throws a null pointer

> exception.

dwga at 2007-7-12 19:08:42 > top of Java-index,Desktop,Core GUI APIs...
# 3
> which gets numerical input from 2 textboxes, Whats a "textBox"? I don't see that component in the API.
camickra at 2007-7-12 19:08:42 > top of Java-index,Desktop,Core GUI APIs...
# 4
sorry i mean textfield, it's getting late.
TheRidgea at 2007-7-12 19:08:42 > top of Java-index,Desktop,Core GUI APIs...