It is possible to develop visual classes that are descendants from my base classes? [message #613680] |
Fri, 04 August 2006 13:27 |
Alexey Kuznetsov Messages: 42 Registered: July 2009 |
Member |
|
|
Hello, All!
Eclipse 3.2 final
VE 1.2 final
It is possible to develop visual classes that are descendants from my base classes?
Actualy I create base dialog with 3 panels on it
First panel - is a general layer
Second panel - is for possible buttons
Third panel - is for possible controls
Base dialog opened in VE perfectly.
After that I create a descendant from it and try to open in VE in order to put some controls
at Second and Third panels, but I CANT put anything :((
I write code manualy that adding controls and run my descendant dialog - at run time it looks fine
but in VE it is not.
Any suggestions???
Here smple code
----------- Base dlg code ----------
package test.ve;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import javax.swing.JDialog;
import javax.swing.JPanel;
public class BaseDialog extends JDialog
{
private JPanel pLayer = null;
private JPanel pControls = null;
private JPanel pButtons = null;
public BaseDialog()
{
super();
initialize();
}
private void initialize()
{
this.setTitle("Base dlg");
this.setSize(300, 300);
this.setContentPane(this.getPnlLayer());
}
private JPanel getPnlLayer()
{
if (pLayer == null)
{
pLayer = new JPanel();
pLayer.setLayout(new BorderLayout());
pLayer.add(this.getPnlControls(), BorderLayout.CENTER);
pLayer.add(this.getPnlButtons(), BorderLayout.SOUTH);
}
return pLayer;
}
protected JPanel getPnlControls()
{
if (pControls == null)
{
pControls = new JPanel();
pControls.setBackground(Color.RED);
}
return pControls;
}
protected JPanel getPnlButtons()
{
if (pButtons == null)
{
pButtons = new JPanel();
pButtons.setBackground(Color.BLUE);
pButtons.setPreferredSize(new Dimension(0, 32));
}
return pButtons;
}
public static void main(String[] args)
{
BaseDialog aDlg = new BaseDialog();
aDlg.setModal(true);
aDlg.setVisible(true);
System.exit(0);
}
-------------------- Sample dlg code --------------
package test.ve;
public class SampleDialog extends BaseDialog
{
public SampleDialog()
{
super();
initialize();
}
private void initialize()
{
this.setTitle("Sample dlg");
initialize();
}
public static void main(String[] args)
{
SampleDialog aDlg = new SampleDialog();
aDlg.setModal(true);
aDlg.setVisible(true);
System.exit(0);
}
}
}
With best regards, Alexey Kuznetsov. E-mail: kuaw26@mail.ru
|
|
|
Powered by
FUDForum. Page generated in 0.02239 seconds