visual editor 初体验

emf-sdo-runtime-2.2.0
GEF-runtime-3.2
JEM-runtime-1.2.3_jem
VE-SDK-1.2.3_jem 中对应的features和plugins扔到eclipse对应的目录中去
.[安装后启动后始终没有"visual class"此项目,终于找到解决办法] 关闭eclipse.把Eclipse安装目录Configuration里除了Config.ini其他文件夹都删掉.



import javax.swing.SwingUtilities;
import java.awt.BorderLayout;
import javax.swing.JPanel;
import javax.swing.JFrame;
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JTree;

public class Test extends JFrame {

private static final long serialVersionUID = 1L;

private JPanel jContentPane = null;

private JCheckBox jCheckBox = null;

private JLabel jLabel = null;

private JTree jTree = null;

/**
* This method initializes jCheckBox
*
* @return javax.swing.JCheckBox
*/
private JCheckBox getJCheckBox() {
if (jCheckBox == null) {
jCheckBox = new JCheckBox();
}
return jCheckBox;
}

/**
* This method initializes jTree
*
* @return javax.swing.JTree
*/
private JTree getJTree() {
if (jTree == null) {
jTree = new JTree();
}
return jTree;
}

/**
* @param args
*/
public static void main(String[] args) {
// TODO 自动生成方法存根
SwingUtilities.invokeLater(new Runnable() {
public void run() {
Test thisClass = new Test();
thisClass.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
thisClass.setVisible(true);
}
});
}

/**
* This is the default constructor
*/
public Test() {
super();
initialize();
}

/**
* This method initializes this
*
* @return void
*/
private void initialize() {
this.setSize(300, 200);
this.setContentPane(getJContentPane());
this.setTitle("JFrame");
}

/**
* This method initializes jContentPane
*
* @return javax.swing.JPanel
*/
private JPanel getJContentPane() {
if (jContentPane == null) {
jLabel = new JLabel();
jLabel.setText("JLabel");
jContentPane = new JPanel();
jContentPane.setLayout(new BorderLayout());
jContentPane.add(getJCheckBox(), BorderLayout.NORTH);
jContentPane.add(jLabel, BorderLayout.WEST);
jContentPane.add(getJTree(), BorderLayout.CENTER);
}
return jContentPane;
}

}  //  @jve:decl-index=0:visual-constraint="52,9"


你可能感兴趣的:(eclipse,swing)