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]

> > 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]
> > 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]
> > 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]