2025-03-05 12:29:30 +01:00
|
|
|
import javax.swing.*;
|
|
|
|
import java.awt.*;
|
|
|
|
|
|
|
|
public class MainFond {
|
|
|
|
public static void main(String[] args) {
|
|
|
|
JFrame frame = new JFrame("Fond");
|
|
|
|
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
|
|
|
|
|
|
|
2025-03-05 20:38:02 +01:00
|
|
|
Fond panel = new Fond();
|
2025-03-05 12:29:30 +01:00
|
|
|
|
2025-03-05 20:44:11 +01:00
|
|
|
frame.add(panel);
|
2025-03-05 12:29:30 +01:00
|
|
|
frame.setSize(500,500);
|
|
|
|
frame.setLocation(500,250);
|
|
|
|
frame.setVisible(true);
|
|
|
|
}
|
2025-03-05 20:38:02 +01:00
|
|
|
}
|
|
|
|
|
2025-03-05 20:44:11 +01:00
|
|
|
|
|
|
|
./Fond.java:4: error: cannot find symbol
|
|
|
|
public class Fond extends JPanel implements ActionListener {
|
|
|
|
^
|
|
|
|
symbol: class ActionListener
|
2025-03-05 20:38:02 +01:00
|
|
|
./Fond.java:27: error: cannot find symbol
|
|
|
|
public void actionPerformed(ActionEvent evenement) {
|
|
|
|
^
|
|
|
|
symbol: class ActionEvent
|
|
|
|
location: class Fond
|
|
|
|
./Fond.java:17: error: incompatible types: Fond cannot be converted to ActionListener
|
|
|
|
this.Cyan.addActionListener(this);
|
|
|
|
^
|
|
|
|
./Fond.java:18: error: incompatible types: Fond cannot be converted to ActionListener
|
|
|
|
this.Magenta.addActionListener(this);
|
|
|
|
^
|
|
|
|
./Fond.java:19: error: incompatible types: Fond cannot be converted to ActionListener
|
|
|
|
this.Jaune.addActionListener(this);
|
|
|
|
^
|
|
|
|
./Fond.java:26: error: method does not override or implement a method from a supertype
|
|
|
|
@Override
|
|
|
|
^
|
|
|
|
./Fond.java:33: error: cannot find symbol
|
2025-03-05 20:44:11 +01:00
|
|
|
setBackground(Color.JAUNE);
|
|
|
|
^
|
2025-03-05 20:38:02 +01:00
|
|
|
symbol: variable JAUNE
|
|
|
|
location: class Color
|
2025-03-05 20:44:11 +01:00
|
|
|
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
|
|
|
|
7 errors
|
|
|
|
[srivasta@vm-srivasta 1.Fond]$ q
|
|
|
|
[srivasta@vm-srivasta 1.Fond]$ javac MainFond.java
|
|
|
|
./Fond.java:4: error: cannot find symbol
|
|
|
|
public class Fond extends JPanel implements ActionListener {
|
|
|
|
^
|
|
|
|
symbol: class ActionListener
|
|
|
|
./Fond.java:28: error: cannot find symbol
|
|
|
|
public void actionPerformed(ActionEvent evenement) {
|
|
|
|
^
|
|
|
|
symbol: class ActionEvent
|
2025-03-05 20:38:02 +01:00
|
|
|
location: class Fond
|
2025-03-05 20:44:11 +01:00
|
|
|
./Fond.java:18: error: incompatible types: Fond cannot be converted to ActionListener
|
|
|
|
this.Cyan.addActionListener(this);
|
|
|
|
^
|
|
|
|
./Fond.java:19: error: incompatible types: Fond cannot be converted to ActionListener
|
|
|
|
this.Magenta.addActionListener(this);
|
|
|
|
^
|
|
|
|
./Fond.java:20: error: incompatible types: Fond cannot be converted to ActionListener
|
|
|
|
this.Jaune.addActionListener(this);
|
|
|
|
^
|
|
|
|
./Fond.java:27: error: method does not override or implement a method from a supertype
|
|
|
|
@Override
|
|
|
|
^
|
2025-03-05 20:38:02 +01:00
|
|
|
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
|
2025-03-05 20:44:11 +01:00
|
|
|
6 errors
|