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