SHARE
TWEET

Untitled

a guest Jun 25th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package View;
  2. import java.awt.BorderLayout;
  3. import java.awt.Container;
  4. import java.awt.FlowLayout;
  5. import java.awt.GridLayout;
  6. import javax.swing.JButton;
  7. import javax.swing.JFrame;
  8. import javax.swing.JLabel;
  9. import javax.swing.JPanel;
  10. import javax.swing.JScrollPane;
  11. import javax.swing.JTree;
  12. import javax.swing.SwingConstants;
  13. import javax.swing.tree.DefaultMutableTreeNode;
  14. import javax.swing.tree.DefaultTreeModel;
  15. import javax.swing.tree.TreePath;
  16.  
  17. public class TransfertUI extends JFrame{
  18.  
  19.     JPanel panel = new JPanel();
  20.     private JLabel lTitre = new JLabel("Opération de ransfert");
  21.     JPanel pSouth = new JPanel(new FlowLayout());
  22.     private JLabel label = new JLabel(">>", SwingConstants.CENTER);
  23.     private JButton bValider = new JButton("Valider");
  24.     private JButton bAnuuler = new JButton("Anuuler");
  25.  
  26.     public TransfertUI() {
  27.         JCheckBoxTree tree1 = new JCheckBoxTree();
  28.         JCheckBoxTree tree2 = new JCheckBoxTree();
  29.  
  30.  
  31.         DefaultMutableTreeNode cimetiere=new DefaultMutableTreeNode("Cimetiere");  
  32.         DefaultMutableTreeNode carre1=new DefaultMutableTreeNode("carré 1 ");  
  33.         DefaultMutableTreeNode carre2=new DefaultMutableTreeNode("carré 2");  
  34.         cimetiere.add(carre1);  
  35.         cimetiere.add(carre2);  
  36.         DefaultMutableTreeNode t1=new DefaultMutableTreeNode("tombe 1");  
  37.         DefaultMutableTreeNode t2=new DefaultMutableTreeNode("tombe 2");  
  38.         DefaultMutableTreeNode d1=new DefaultMutableTreeNode("defunt 1");  
  39.         DefaultMutableTreeNode d2=new DefaultMutableTreeNode("defunt 2");  
  40.         carre1.add(t1); carre1.add(t2); t1.add(d1); t2.add(d2);  
  41.  
  42.  
  43.  
  44.         DefaultTreeModel model = new DefaultTreeModel(cimetiere);
  45.         tree1.setModel(model);
  46.        // tree2.setModel(model);
  47.  
  48.         JScrollPane scrollPane1 = new JScrollPane(tree1);
  49.         JScrollPane scrollPane2 = new JScrollPane(tree2);
  50.  
  51.  
  52.  
  53.  
  54.  
  55.         panel.setLayout(new GridLayout(1,3));
  56.         panel.add(scrollPane1);
  57.         panel.add(label);
  58.         panel.add(scrollPane2);
  59.  
  60.         this.setLayout(new BorderLayout());
  61.  
  62.         pSouth.add(bValider);
  63.         pSouth.add(bAnuuler);
  64.         this.add(pSouth,BorderLayout.SOUTH);
  65.         this.add(lTitre,BorderLayout.NORTH);
  66.  
  67.  
  68.         this.add(panel,BorderLayout.CENTER);
  69.         this.setSize(650, 400);
  70.         this.setDefaultCloseOperation(EXIT_ON_CLOSE);
  71.         this.setVisible(true);
  72.         this.setTitle("Opération de transfert - Finalys");
  73.     }
  74.  
  75.  
  76.     public static void main(String[] args) {
  77.        new TransfertUI();
  78.     }
  79.  
  80.  
  81. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top