package fenetres; import java.awt.Font; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.SwingConstants; import MEPTL.commandes; import javax.swing.JButton; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; public final class about extends JFrame { private static about instance; /** * */ private static final long serialVersionUID = 1L; /** * Create the application. */ public about() { initialize(); setVisible(true); } /** * Initialize the contents of the frame. */ private void initialize() { setResizable(false); setTitle(commandes.Titre); setLocation(100, 100); setSize(518,415); int screenWidth = (int) java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().getWidth(); int screenHeight = (int) java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().getHeight(); setLocation(( (screenWidth) - getWidth()) / 2, (screenHeight - getHeight()) / 2); setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); getContentPane().setLayout(null); ImageIcon img = new ImageIcon(getClass().getResource("/evalwriter.png") ); setIconImage(img.getImage()); JPanel contentPane = (JPanel) getContentPane(); JLabel lblNewLabelTitre = new JLabel(); ImageIcon img2 = new ImageIcon(getClass().getResource("/accueil.png") ); lblNewLabelTitre.setIcon(img2); lblNewLabelTitre.setHorizontalAlignment(SwingConstants.LEFT); lblNewLabelTitre.setFont(new Font("Pacifico", Font.PLAIN, 26)); lblNewLabelTitre.setBounds(10, 10, 357, 90); contentPane.add(lblNewLabelTitre); JLabel lblNewLabelVersion = new JLabel("Version : " + commandes.version + " "+ commandes.nomDeLaBranch + ""); lblNewLabelVersion.setFont(new Font("Tahoma", Font.PLAIN, 16)); lblNewLabelVersion.setBounds(20, 100, 240, 20); contentPane.add(lblNewLabelVersion); JLabel lblNewLabelAnnee = new JLabel("Année : " + commandes.Annee + ""); lblNewLabelAnnee.setFont(new Font("Tahoma", Font.PLAIN, 16)); lblNewLabelAnnee.setBounds(20, 120, 240, 20); contentPane.add(lblNewLabelAnnee); JLabel lblCredit = new JLabel("Crédit"); lblCredit.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 14)); lblCredit.setBounds(20, 268, 60, 20); getContentPane().add(lblCredit); JLabel lblNewLabelAuteur = new JLabel("Auteur : Pablo Rodriguez"); lblNewLabelAuteur.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblNewLabelAuteur.setBounds(20, 286, 240, 20); contentPane.add(lblNewLabelAuteur); JLabel lblInformationEnseignant = new JLabel("Enseignants à l'université d'Artois"); lblInformationEnseignant.setFont(new Font("Tahoma", Font.PLAIN, 12)); lblInformationEnseignant.setBounds(20, 299, 296, 20); getContentPane().add(lblInformationEnseignant); JLabel lblCommentaire = new JLabel("Outil permettant l’évaluation des fichiers réalisés avec un traitement de texte au format ODF.

" + "Cet outil a été créé dans un esprit de partage.
"); lblCommentaire.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblCommentaire.setHorizontalAlignment(SwingConstants.LEFT); lblCommentaire.setVerticalAlignment(SwingConstants.TOP); lblCommentaire.setBounds(20, 183, 472, 88); getContentPane().add(lblCommentaire); JLabel lblLicence = new JLabel("Licence : GNU GLP 3.0 "); lblLicence.setFont(new Font("Tahoma", Font.PLAIN, 14)); lblLicence.setBounds(305, 261, 187, 35); getContentPane().add(lblLicence); JButton btnNewButton = new JButton("

Vérifier s'il y a
une nouvelle version

"); btnNewButton.setFont(new Font("Tahoma", Font.BOLD, 14)); btnNewButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { String url = "https://forge.chapril.org/pablo/analyseWriter/releases"; java.awt.Desktop.getDesktop().browse(java.net.URI.create(url)); } catch (java.io.IOException e1) { System.out.println(e1.getMessage()); } } }); btnNewButton.setBounds(270, 100, 222, 72); getContentPane().add(btnNewButton); JLabel lblGPL3 = new JLabel(""); lblGPL3.setHorizontalAlignment(SwingConstants.CENTER); lblGPL3.setIcon(new ImageIcon(about.class.getResource("/resources/GPLv3.png"))); lblGPL3.setBounds(315, 283, 139, 70); getContentPane().add(lblGPL3); } public static about getInstance() { if (instance == null) { instance = new about(); } instance.setVisible(true); return instance; } }