Commit 9a99c8a8 authored by Baptiste Fournier's avatar Baptiste Fournier

added addImage method to add image to the picture from path from main()

parent bfea964c
No preview for this file type
import javax.swing.*;
import java.awt.*;
import boundary.*;
import control.*;
......@@ -12,16 +10,7 @@ public class TestSwing {
public static void main(String[] args) {
MonControleur Control = new MonControleur();
MaFenetre MainFrame = new MaFenetre(Control);
Dimension preferredSize = new Dimension(1000,1000);
MainFrame.setPreferredSize(preferredSize);
MainFrame.setTitle("Graphisme avec Swing");
MainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
MainFrame.setVisible(true);
MainFrame.pack();
MainFrame.addImage("logo-CS-blanc.png");
}
}
......@@ -26,6 +26,12 @@ public class MaFenetre extends JFrame implements KeyListener{
this.setTitle("Graphisme avec Swing");
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setVisible(true);
this.pack();
}
public void addImage(String path){
controller.newImage(path);
}
public void keyPressed(KeyEvent e){}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment