Bonjour,
J'essaye de faire un Splash screen pour la fin de mon appli.
Quand je rends ma JFrame non visible le splash screen disparait.
Je ne sais pas comment eviter cela et n'avoir que mon splash screen durant la fermeture de mon appli.
Voici un peu de code :
le constructeur du splsh screen
Dans la JDialog de ma MaJFrame
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 public SplashWindow(String imagePath) { super(); Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize(); if (imagePath != null && !imagePath.equals("")) { try{ animPanel = new AnimPanel ("Stop Processing ...."); int animPanelHeight = (int)(animPanel.getPreferredSize().getHeight()); int animPanelWidth = (int)(animPanel.getPreferredSize().getWidth()); int imgX = (screenDimension.width - animPanelWidth) / 2; int imgY = (screenDimension.height - animPanelHeight) / 2; add(animPanel); setLocation(imgX,imgY); animPanel.start(); } catch(Throwable e){JOptionPane.showMessageDialog(this,e);} } else { setLocation(screenDimension.width / 2, screenDimension.height / 2); } pack(); setVisible(true); }
Merci d'avnce.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 ok.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { SplashWindow s = SplashWindow.getInstance("image/imageFin.jpg"); MaJFrame.this.setVisible(false); fin(); } });




Répondre avec citation










quand une réponse a été apportée à votre question. Aucune réponse ne sera donnée à des messages privés portant sur des questions d'ordre technique. Les forums sont là pour que vous y postiez publiquement vos problèmes.
suivez 
Partager