OK、このエラーが発生していますawt eventqueue 0 nullpointerexception error
。を削除しようとするとJPanel
。
私を混乱させているのは、別のものを削除するJPanel
と完全に正常に機能しますが、これはそうではありません。以下の最初のコードは、JPanel
をクリックしてJButton
も が削除されないことを示していますJPanel
。
public class buttontime implements ActionListener { //creating actionlistener for clicking on timebutton to bring up a combobox
public void actionPerformed(ActionEvent clickTime) {
Price priceObject = new Price();
priceObject.getPricepanel();
remove(priceObject.getPricepanel());
priceObject.getPricepanel().revalidate();
add(timeObject.getTimePanel(), BorderLayout.EAST);
timeObject.getTimePanel().revalidate();
}
}
//This one gives me 0 errors.
public class buttonprice implements ActionListener { //creating actionlistener for clicking on timebutton to bring up a combobox
public void actionPerformed(ActionEvent ClickPrice) {
Price priceObject = new Price();
priceObject.SelectPrice();
remove(timeObject.getTimePanel());
timeObject.getTimePanel().revalidate();
add(priceObject.getPricepanel(), BorderLayout.EAST);
priceObject.getPricepanel().revalidate();
}
}