JPanel, JDialog

I have been develloping this application for months now and i worked with jinternalframe, jdialog, jpanel, jframe and many others swing components. And now suddenly all the new classes i create since yesterday do no do what i want them to do.

I have a jdialog and it wont show anything. the jdialog will pop up but it will be empty. I try many thing like instead of this.add i used this.getContentPane().add(new AccountSelectorPanel(), BorderLayout.CENTER); but wallou here is the code.

privateclass AccountSelectorextends JDialog

{

public AccountSelector()

{

aAccountSelector =this;

this.setTitle("Select an Account");

this.setSize(350, 100);

this.setLocation(50, 200);

this.setResizable(false);

this.setAlwaysOnTop(true);

this.setVisible(true);

this.setModal(true);

this.setBackground(Color.red);

this.add(new AccountSelectorPanel())

}

privateclass AccountSelectorPanelextends JPanel

{

public AccountSelectorPanel()

{

this.setLayout(null);

this.setBackground(Color.blue);

accountCombo =new JComboBox();

accountCombo.setBounds(20, 20, 220, 20);

this.add(accountCombo);

JButton close =new JButton("Close");

close.addActionListener(new ActionListener()

{

publicvoid actionPerformed(ActionEvent arg0)

{

//done();

}

});

close.setBounds(250, 20, 80, 20);

this.add(close);

}

}

private AccountSelector aAccountSelector;

private JComboBox accountCombo;

}

I create all my gui so far with this method and it is working, so what is wrong with this?

how come the others one works fine and this one doesn t

[2882 byte] By [lildavesflavaa] at [2007-11-27 4:42:06]
# 1
> how come the others one works fine and this one doesn tdo the others also show (setVisible(true)) before adding anything to the component?
Michael_Dunna at 2007-7-12 9:53:39 > top of Java-index,Desktop,Core GUI APIs...
# 2
yes they work finei change the sequence and it works u were right i research the others onesthe reason they were working is because some other methor inside those classes refreshed it thanks
lildavesflavaa at 2007-7-12 9:53:39 > top of Java-index,Desktop,Core GUI APIs...