Exceptions

hey, i've got this code:

buttonCrypt.addActionListener(new ActionListener(){

publicvoid actionPerformed(ActionEvent e){

Vigenere.setKey(KeyField.getText().trim());

Vigenere.setPlainText(frame.takeTextFromSelected());

frame.createResultFrame(Vigenere.crypt());

dispose();

}

});

and now i want to do something like this: when user not set any text to KeyField (method getText() take nothing from KeyField) and press a buttonCrypt there is shown a JDialog with text: "Please enter a key" and "OK" button. I tried modify this code like that:

buttonCrypt.addActionListener(new ActionListener(){

publicvoid actionPerformed(ActionEvent e){

if(KeyField.getText() ==null || KeyField.getText().equals("")){

//show JDialog etc.....<- i have no problem to do this

}else{

setKey(KeyField.getText());

}

Vigenere.setPlainText(frame.takeTextFromSelected());

frame.createResultFrame(Vigenere.crypt());

dispose();

}

});

but anyway if i compile this code there is shown this information:

"Exception occurred during event dispatching:

java.lang.NullPointerException....". I think it isn't well, is it?

I hope that you understand me and my problem :)

cya

[1976 byte] By [thud_Mikea] at [2007-11-27 5:48:57]
# 1
The great think about Java's runtime errors (as anyone who has seen theC error "segmentatation fault -- core dump" will tell you), they provide a lotof information, like the exact line where the null pointer exception occurred.Hmmm...
Hippolytea at 2007-7-12 15:34:52 > top of Java-index,Java Essentials,New To Java...
# 2
> C error "segmentatation fault -- core dump" You still stuck on yawmark's, "huge...tracts of user interface" comment?
filestreama at 2007-7-12 15:34:52 > top of Java-index,Java Essentials,New To Java...
# 3

> > C error "segmentatation fault -- core dump"

>

>

> You still stuck on yawmark's, "huge...tracts of user

> interface" comment?

Now that you mention it, I'm trying to eat less junk food and more fruit,

so I'm staring at two firm, ripe mangoes on my desk:

[url #" style="display: block; background-image: url('http://ramblingspoon.com/blog/wp-content/uploads/2006/06/Mangoes.jpg'); width: 300px; height: 199px] [/url]

Hippolytea at 2007-7-12 15:34:52 > top of Java-index,Java Essentials,New To Java...
# 4
The wife, kids, and I went shopping two days ago at a nearby produce market.We purchased some really nice mangoes. My guess is that they are from Central or South America. There are ca. 1 000 varieties of mangos.
filestreama at 2007-7-12 15:34:52 > top of Java-index,Java Essentials,New To Java...
# 5

> > You still stuck on yawmark's, "huge...tracts of

> user

> > interface" comment?

>

> Now that you mention it, I'm trying to eat less junk

> food and more fruit,

> so I'm staring at two firm, ripe mangoes on my desk:

The mango has a terrible user interface: it requires external tools (e.g. a paring knife) to even render it ready for user consumption... now, an orange is the user-ready fruit...

[url #" style="display: block; background-image: url('http://www.fotosearch.com/comp/FDC/FDC101/900077.jpg'); width: 300px; height: 199px] [/url]

kevjavaa at 2007-7-12 15:34:52 > top of Java-index,Java Essentials,New To Java...
# 6
And a kumquat?
Hippolytea at 2007-7-12 15:34:52 > top of Java-index,Java Essentials,New To Java...
# 7
> And a kumquat?Lots of work, and you might even burn more calories trying to get the $&^# thing open than you gain by eating it.
kevjavaa at 2007-7-12 15:34:52 > top of Java-index,Java Essentials,New To Java...
# 8

> > And a kumquat?

>

> Lots of work, and you might even burn more calories

> trying to get the $&^# thing open than you gain by

> eating it.

Makes you wish you could just pop them in your mouth and eat the whole thang ;-)

But if I could have one fruit right now, It would be mangosteen. I can deal with the interface.

[url #" style="display: block; background-image: url('http://www.fruitlovers.com/Mangosteen.jpg'); width: 512px; height: 768px] [/url]

Hippolytea at 2007-7-12 15:34:52 > top of Java-index,Java Essentials,New To Java...
# 9
> But if I could have one fruit right now, It would be> mangosteen. I can deal with the interface.You win, hands-down, the Sun Forums Dennis Miller Award For Obscure References?
kevjavaa at 2007-7-12 15:34:52 > top of Java-index,Java Essentials,New To Java...
# 10
> You win, hands-down, the Sun Forums Dennis Miller Award For Obscure References?Are we not The Cognoscenti?
Hippolytea at 2007-7-12 15:34:52 > top of Java-index,Java Essentials,New To Java...
# 11
> > You win, hands-down, the Sun Forums Dennis Miller> Award For Obscure References?> > Are we not The Cognoscenti?<mutters> Dang... Twice in one thread...</mutters>*runs off to Google again...*
kevjavaa at 2007-7-12 15:34:52 > top of Java-index,Java Essentials,New To Java...
# 12
Should I have just said "Feinschmecker"?
Hippolytea at 2007-7-12 15:34:52 > top of Java-index,Java Essentials,New To Java...
# 13
sorry for my stupid question, i've already done it :/cya,thud
thud_Mikea at 2007-7-12 15:34:52 > top of Java-index,Java Essentials,New To Java...
# 14
> Should I have just said "Feinschmecker"?<sighs/> :)> sorry for my stupid question, i've already done it :/> cya,Glad we could be of assistance :).> thud Sounds like it might have hurt. Be well, take care.
kevjavaa at 2007-7-12 15:34:52 > top of Java-index,Java Essentials,New To Java...