1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| public class DrawNode extends JTable {
Noeud n;
public DrawNode(Noeud n) {
this.n=n;
new JTable(1,6);
setSize(110,16);
}
public static void main(String[] args) {
JFrame window=new JFrame("Test d'un dessin de Noeud");
JPanel panel=new JPanel();
panel.setLayout(null);
Noeud n=new Noeud();
n.add("abcd");
DrawNode node=new DrawNode(n);
panel.add(node);
window.getContentPane().add(panel);
window.setLocationRelativeTo(null);
window.setBounds(0, 0,400, 200);
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
window.setVisible(true);
}
} |
Partager