import javax.imageio.ImageIO; import javax.swing.*; import java.awt.*; /** * Ecran de démarrage du logiciel */ public class AppThinkerSplashscreen extends JFrame { /** * Constructeur - Crée la fenêtre de démarrage */ public AppThinkerSplashscreen(){ this.setTitle("AppThinker - Starting"); this.setMinimumSize(new Dimension(600, 300)); Image img = null; try { img = ImageIO.read(AppThinker.class.getResource("img/logoAppThinker.png")); } catch (Exception ex) { } this.setIconImage(img); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setLocationRelativeTo(null); this.setUndecorated(true); JPanel panel = new JPanel(){ @Override protected void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2 = (Graphics2D) g; RenderingHints rh = new RenderingHints(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); g2.setRenderingHints(rh); Image img = null; try { img = ImageIO.read(AppThinker.class.getResource("img/splashscreen.png")); } catch (Exception ex) { } g2.drawImage(img, 0, 0, 600, 300, this); /*Informations du logiciel*/ g2.setColor(new Color(63, 169, 245)); g2.setFont(new Font("Arial", Font.BOLD, 40)); g2.drawString("AppThinker", 305, 45); g2.setFont(new Font("Arial", Font.PLAIN, 20)); g2.drawString("Make your ideas come true", 285, 280); g2.setFont(new Font("Arial", Font.BOLD, 10)); g2.drawString("We're getting things ready...", 5, 295); g2.drawString(AppThinker.developer + " © 2020 - Version " + AppThinker.version, 305, 295); } }; this.getContentPane().add(panel); this.setVisible(true); } }