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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
| import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
public class inter1 extends Frame{
JFrame frame=new JFrame();
Menu meprinc3 = new Menu("Pcc");
MenuBar mbar = new MenuBar();
MenuItem item6 = new MenuItem("Ford");
public matrice m1,mat;
boolean er1,er;
Graphisme l4;
int o=100;
public boolean bol;
TextArea listInitial1=new TextArea();
File fFile = new File ("");
TextArea l2=new TextArea();
int n;int i=0,j=0;
public inter1() {
meprinc3.add(item6);
mbar.add(meprinc3);
this.setMenuBar(mbar);
public boolean openFile ()
{ }//l'nterface d'ouvrir des fichier
public String readFile (File file) { } /* permet de remplir les valeurs de fichier en matrice*/
public static void main (String[] args) {
Menu meprinc3 = new Menu("Pcc");
MenuBar mbar = new MenuBar();
MenuItem item6 = new MenuItem("Ford");
meprinc3.add(item6);
mbar.add(meprinc3);
inter1 l5=new inter1();
l5.setMenuBar(mbar);
l5.setSize(500,500);
item6.addActionListener(new java.awt.event.ActionListener() {public void actionPerformed ( ActionEvent e ){
boolean status = false;
int k=0;String l;
boolean el=false;
String command = e.getActionCommand ();
if ((command.equals ("Ford")))
{inter1 l5=new inter1();
status=l5.openFile();
if(!status)JOptionPane.showMessageDialog(null,"Error opening file!",
"File Open Error",JOptionPane.ERROR_MESSAGE );
//traitement
while((i<l5.n)&&(l5.er==false))
{final JFrame frame = new JFrame();
frame.addWindowListener (new WindowAdapter( ) {
public void windowClosing(WindowEvent e)
{ System.exit(0);
}
});
Graphisme l4=new Graphisme(m1,i,j,k3);
frame.add(l4);
frame.setLocationRelativeTo(null);
// frame.setBackground(Color.lightGray);
frame.setSize(500,500);
frame.setVisible(true);
new Thread( new Runnable() {
public void run() {
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
}
SwingUtilities.invokeLater(new Runnable() {
public void run() {
frame.setVisible(false);
}
});
}
}).start();
//traitement
} |
Partager