hei guys!
Sunny in your side of the world the same as in mine? :)
I'm trying to do a pop-up window (Frame) that will allow me to check some things from a checkPanel and insert a string in a JTextField. Then I have a TextArea object that is supposed to display me a string containing what I checked from my checkPanel together with the String inserted in the TextField when I click on a doneButton.
But the coded gives me a Null pointer exception and I have everything initialized...dunno what it can be...
I would really appreciat some help to move on with this part of my project!
Thank you for your time!!!
//constructor
public SetNewFilter () {
...
JTextArea textArea = new JTextArea(5, 20);
pane.add(checkPanel, c);
JTextField textField=new JTextField(20);
pane.add(textField, c);
pane.add(textArea,c);
//my done button
Action doneAction = new DoneAction("Done");
JButton doneButton= new JButton(doneAction);
pane.add(doneButton,c);
}
class DoneAction extends AbstractAction {
//public JTextField txtField;
public DoneAction(String text) {
super(text);
}
public void actionPerformed(ActionEvent e) {
String text = textField.getDocument();
textArea.append("Your filter name is:"+text+"\n");
textArea.append("Your filter will monitor after the following protocols:"+protocols);
textField.selectAll();
//protocols is a StringBuffer containig a String of what I checked in the the //checkpanel
//either the textArea either the textField don't reach this method :(...dunno why
}
Thanks again!
Cristina