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 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| public MalfunctionIHM() {
this.setTitle("Malfunction");
this.setSize(480, 180);
this.setLocationRelativeTo(null);
this.setResizable(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
pan1 = new JPanel(new GridBagLayout());
Insets insets = new Insets(5, 5, 5, 5);
pdfFile = new JTextField();
pdfFile.setEditable(false);
pdfFile.setText("Chercher votre fichier pdf");
buttonOpenPdfFile = new JButton(" ");
textFile = new JTextField();
textFile.setEditable(false);
textFile.setText("Chercher votre fichier txt");
buttonOpenTextFile = new JButton(" ");
saveFile = new JTextField();
saveFile.setEditable(false);
saveFile.setText("Enregistrer sous");
buttonSaveFile = new JButton(" ");
GridBagConstraints gbcTextField = new GridBagConstraints(0,GridBagConstraints.RELATIVE,1,1,1,1,GridBagConstraints.CENTER,GridBagConstraints.BOTH,insets,0,0);
GridBagConstraints gbcButton = new GridBagConstraints(1,GridBagConstraints.RELATIVE,1,1,0,0,GridBagConstraints.CENTER,GridBagConstraints.NONE,insets,0,0);
pan1.add(pdfFile,gbcTextField);
pan1.add(buttonOpenPdfFile,gbcButton);
pan1.add(textFile,gbcTextField);
pan1.add(buttonOpenTextFile,gbcButton);
pan1.add(saveFile,gbcTextField);
pan1.add(buttonSaveFile,gbcButton);
GridBagConstraints gbcExec = new GridBagConstraints(2,3,1,1,0,0,GridBagConstraints.CENTER,GridBagConstraints.NONE,insets,0,0);
buttonExecuteMalfunction = new JButton("Executer");
pan1.add(buttonExecuteMalfunction,gbcExec);
pan1.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
this.getContentPane().add(pan1);
this.setVisible(true);
} |
Partager