import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import com.mxgraph.swing.mxGraphComponent;
import com.mxgraph.view.mxGraph;
public class verwaltung {
static JFrame mainframe = new JFrame("");
static JPanel p_mitte = new JPanel();
static JPanel p_oben = new JPanel();
static JPanel p_rechts = new JPanel();
static JPanel p_links = new JPanel();
JPanel p_parameter = new JPanel();
JPanel p_ziel = new JPanel();
JPanel p_aktion = new JPanel();
JPanel P_elemente = new JPanel();
JPanel p_assoziation = new JPanel();
static JButton b_test = new JButton("ADD");
JLabel l_parameter = new JLabel("Parameter");
JLabel l_ziel = new JLabel("Aufgabe");
JLabel l_aktion = new JLabel("");
static JLabel l_elemente = new JLabel("Elemente");
JLabel l_assoziation = new JLabel("Assoziationen");
static mxGraph graph = new mxGraph();
static Object parent = graph.getDefaultParent();
static Object v1 = graph.insertVertex(parent, null, "Hello", 20, 20, 80,
30);
static Object v2 = graph.insertVertex(parent, null, "World!", 240, 150,
80, 30);
Object v3 = graph.insertVertex(parent, null, "Hello", 20, 20, 80,
30);
public static void main(String [] args)
{
//mainframe
mainframe.setLayout(new BorderLayout());
mainframe.setExtendedState(JFrame.MAXIMIZED_BOTH);
mainframe.add(p_oben,BorderLayout.NORTH);
mainframe.add(p_rechts,BorderLayout.WEST);
mainframe.add(p_mitte,BorderLayout.CENTER);
mainframe.add(p_links,BorderLayout.EAST);
//p_mitte
p_mitte.setBackground(Color.WHITE);
graph.getModel().beginUpdate();
try
{
graph.insertEdge(parent, null, "Edge", v1, v2);
}
finally
{
graph.getModel().endUpdate();
}
mxGraphComponent graphComponent = new mxGraphComponent(graph);
p_mitte.add(graphComponent);
//p_links
p_links.add(l_elemente);
p_links.add(b_test);
b_test.addActionListener(new ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
// Hier moechte ich v3 hinzufügen
}});
mainframe.setVisible(true);
}
}