Inversion des slashs
This commit is contained in:
parent
e5cc58a082
commit
d82d562645
|
|
@ -33,7 +33,7 @@ public class JPanelImage extends JPanel {
|
|||
|
||||
private void chargerImage(){
|
||||
if(sNomImage!=null) {
|
||||
String sNomFile=".\\images\\"+sNomImage;
|
||||
String sNomFile=".//images//"+sNomImage;
|
||||
try {
|
||||
image = ImageIO.read(new File(sNomFile));
|
||||
} catch (IOException ex) {
|
||||
|
|
|
|||
|
|
@ -26,10 +26,10 @@ public class MaJFrame extends JFrame {
|
|||
contentPane.setLayout(new BorderLayout(0, 0));
|
||||
setContentPane(contentPane);
|
||||
|
||||
panel = new JPanelImage();
|
||||
panel = new JPanelImage("image1.jpg");
|
||||
contentPane.add(panel, BorderLayout.NORTH);
|
||||
|
||||
JButton btnNewButton = new JButton("Ne fait Rien !");
|
||||
JButton btnNewButton = new JButton("Clic me !");
|
||||
btnNewButton.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
clicBouton();
|
||||
|
|
@ -42,7 +42,6 @@ public class MaJFrame extends JFrame {
|
|||
}
|
||||
|
||||
public void clicBouton() {
|
||||
panel.setImage("image1.jpg");
|
||||
panel_1.setImage("image2.png");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue