Voila j'ai une classe définit comme suit :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| public abstract class AJPanel_Scrollable extends JScrollPane {
protected IHM mIHM = null;
public AJPanel_Scrollable(IHM pIHM) {
super();
mIHM = pIHM;
init();
}
private void init() {
this.setViewportView(getContent());
}
protected abstract JPanel getContent();
} |
Ainsi qu'une autre qui en hérite :
public class JPanel_InfosSP extends AJPanel_Scrollable
qui définit 2 variables :
1 2
| private Boolean mIsOwner = new Boolean(true);
private boolean mIsAdmin = true; |
surcharge la méthode
1 2 3 4 5 6 7 8 9 10
| @Override
protected JPanel getContent() {
if (mContent == null) {
mContent = new JPanel();
init();
initComponents();
setData();
}
return mContent;
} |
et le problème arrive ici, dans initComponents j'ai ceci :
1 2
| System.out.println(mIsOwner);
System.out.println(mIsAdmin); |
et j'ai cette trace
>>> null
>>> false
WHY???
Partager