我使用CardLayout
显示来自其他类的JPanel
:
card.add("ReadMsg Card", new ReadMessage(id, type, sender));
cl.show(card, "ReadMsg Card");
如何续订/删除" ReadMsg卡"布局中的面板,因为变量id, type, sender
在添加后保持不变?
答案 0 :(得分:0)
您维护对ReadMessage
面板的引用(作为实例字段),并像往常一样从容器中删除它,或者只是使用setters