Hallo alle zusammen
mein problem ist folgendes ich habe ein JFrame und eine Klasse zum löschen der Dateien .
Wenn ich das Programme starte werden erst die Dateien gelöscht und dann das jFrame angezeigt. Es soll aber beides gleichzeitig laufen.
ich habe folgendes Probiert:
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
public class Daten_Delete_ende_GUI extends javax.swing.JFrame {
public Daten_Delete_ende_GUI() throws IOException {
initComponents();
setLocationRelativeTo(null);
String bild = "pics/Euro_3D_Blue.png";
super.setIconImage(ImageIO.read(Daten_Delete_ende_GUI.class.getResourceAsStream(bild)));
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
jLabel1.setForeground(new java.awt.Color(102, 255, 102));
jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
jLabel1.setText("TEST TEXT TEST TEXT TEST TEXT TEST TEXT");
jLabel1.setName(""); // NOI18N
getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(90, 160, 300, -1));
jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/daten_delete_ende_gui/pics/Splash.png"))); // NOI18N
getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, -1, -1));
pack();
}// </editor-fold>
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Daten_Delete_ende_GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Daten_Delete_ende_GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Daten_Delete_ende_GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Daten_Delete_ende_GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
try {
new Daten_Delete_ende_GUI().setVisible(true);
Thread.sleep(1000);
new DatenDelete();
} catch (IOException ex) {
Logger.getLogger(Daten_Delete_ende_GUI.class.getName()).log(Level.SEVERE, null, ex);
} catch (InterruptedException ex) {
Logger.getLogger(Daten_Delete_ende_GUI.class.getName()).log(Level.SEVERE, null, ex);
}
}
});
}
// Variables declaration - do not modify
public static javax.swing.JLabel jLabel1;
public static javax.swing.JLabel jLabel2;
// End of variables declaration
}```
Kann mir jemand weiter helfen oder hat vielleicht jemand schon mal ein solches problem gehabt
vielen danke für eure mühe