Help with DialogWrapper
Hi,
when i invoke the Dialogwrapper subclass implemented as below, i just see the ok and cancel buttons and do not see my panel. can some one point what i am missing?
//Dialogwrapper
public class NewClassDialog extends DialogWrapper {
private NewClassPanel panel;
@Override
protected void doOKAction() {
super.doOKAction(); //To change body of overridden methods use File | Settings | File Templates.
}
protected NewClassDialog(boolean canBeParent) {
super(canBeParent);
init();
panel = new NewClassPanel();
}
@Override
protected JComponent createCenterPanel() {
return panel;
}
}
I invoke insider the button handler in the following function
private void configureAddClass() {
addClassButton = new JButton();
addClassButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
NewClassDialog dialog = new NewClassDialog(true);
dialog.getPeer().setTitle("Add New Class");
dialog.createCenterPanel();
dialog.show();
}
});
NewClassPanel is a class extending Jpanel and have buttons and textfield.
Thanks.
Please sign in to leave a comment.
Hello Deeps,
You need to move the init() call to the end of the constructor.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Thanks a ton Dmitry. you are the saviour !