fix project setup
This commit is contained in:
parent
6a47262c28
commit
77931aa547
25
.classpath
25
.classpath
|
|
@ -1,33 +1,10 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-21">
|
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="module" value="true"/>
|
<attribute name="module" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="src" path="src"/>
|
<classpathentry kind="src" path="src"/>
|
||||||
<classpathentry kind="lib" path="C:/Users/Qpelu/Documents/Eclypse/poi-bin-5.2.3-20220909/poi-bin-5.2.3/lib/commons-codec-1.15.jar"/>
|
|
||||||
<classpathentry kind="lib" path="C:/Users/Qpelu/Documents/Eclypse/poi-bin-5.2.3-20220909/poi-bin-5.2.3/lib/commons-collections4-4.4.jar"/>
|
|
||||||
<classpathentry kind="lib" path="C:/Users/Qpelu/Documents/Eclypse/poi-bin-5.2.3-20220909/poi-bin-5.2.3/lib/commons-io-2.11.0.jar"/>
|
|
||||||
<classpathentry kind="lib" path="C:/Users/Qpelu/Documents/Eclypse/poi-bin-5.2.3-20220909/poi-bin-5.2.3/lib/commons-math3-3.6.1.jar"/>
|
|
||||||
<classpathentry kind="lib" path="C:/Users/Qpelu/Documents/Eclypse/poi-bin-5.2.3-20220909/poi-bin-5.2.3/lib/log4j-api-2.18.0.jar"/>
|
|
||||||
<classpathentry kind="lib" path="C:/Users/Qpelu/Documents/Eclypse/poi-bin-5.2.3-20220909/poi-bin-5.2.3/lib/SparseBitSet-1.2.jar"/>
|
|
||||||
<classpathentry kind="lib" path="C:/Users/Qpelu/Documents/Eclypse/poi-bin-5.2.3-20220909/poi-bin-5.2.3/poi-5.2.3.jar"/>
|
|
||||||
<classpathentry kind="lib" path="C:/Users/Qpelu/Documents/Eclypse/poi-bin-5.2.3-20220909/poi-bin-5.2.3/poi-examples-5.2.3.jar"/>
|
|
||||||
<classpathentry kind="lib" path="C:/Users/Qpelu/Documents/Eclypse/poi-bin-5.2.3-20220909/poi-bin-5.2.3/poi-excelant-5.2.3.jar"/>
|
|
||||||
<classpathentry kind="lib" path="C:/Users/Qpelu/Documents/Eclypse/poi-bin-5.2.3-20220909/poi-bin-5.2.3/poi-javadoc-5.2.3.jar"/>
|
|
||||||
<classpathentry kind="lib" path="C:/Users/Qpelu/Documents/Eclypse/poi-bin-5.2.3-20220909/poi-bin-5.2.3/poi-ooxml-5.2.3.jar"/>
|
|
||||||
<classpathentry kind="lib" path="C:/Users/Qpelu/Documents/Eclypse/poi-bin-5.2.3-20220909/poi-bin-5.2.3/poi-ooxml-full-5.2.3.jar"/>
|
|
||||||
<classpathentry kind="lib" path="C:/Users/Qpelu/Documents/Eclypse/poi-bin-5.2.3-20220909/poi-bin-5.2.3/poi-ooxml-lite-5.2.3.jar"/>
|
|
||||||
<classpathentry kind="lib" path="C:/Users/Qpelu/Documents/Eclypse/poi-bin-5.2.3-20220909/poi-bin-5.2.3/poi-scratchpad-5.2.3.jar"/>
|
|
||||||
<classpathentry kind="lib" path="C:/Users/Qpelu/Documents/Eclypse/poi-bin-5.2.3-20220909/poi-bin-5.2.3/ooxml-lib/commons-compress-1.21.jar"/>
|
|
||||||
<classpathentry kind="lib" path="C:/Users/Qpelu/Documents/Eclypse/poi-bin-5.2.3-20220909/poi-bin-5.2.3/ooxml-lib/commons-logging-1.2.jar"/>
|
|
||||||
<classpathentry kind="lib" path="C:/Users/Qpelu/Documents/Eclypse/poi-bin-5.2.3-20220909/poi-bin-5.2.3/ooxml-lib/curvesapi-1.07.jar"/>
|
|
||||||
<classpathentry kind="lib" path="C:/Users/Qpelu/Documents/Eclypse/poi-bin-5.2.3-20220909/poi-bin-5.2.3/ooxml-lib/jakarta.activation-2.0.1.jar"/>
|
|
||||||
<classpathentry kind="lib" path="C:/Users/Qpelu/Documents/Eclypse/poi-bin-5.2.3-20220909/poi-bin-5.2.3/ooxml-lib/jakarta.xml.bind-api-3.0.1.jar"/>
|
|
||||||
<classpathentry kind="lib" path="C:/Users/Qpelu/Documents/Eclypse/poi-bin-5.2.3-20220909/poi-bin-5.2.3/ooxml-lib/slf4j-api-1.7.36.jar"/>
|
|
||||||
<classpathentry kind="lib" path="C:/Users/Qpelu/Documents/Eclypse/poi-bin-5.2.3-20220909/poi-bin-5.2.3/ooxml-lib/xmlbeans-5.1.1.jar"/>
|
|
||||||
<classpathentry kind="lib" path="C:/Users/Qpelu/Downloads/log4j-core-2.9.1.jar"/>
|
|
||||||
<classpathentry kind="lib" path="C:/Users/Qpelu/Downloads/opencsv-5.7.1.jar"/>
|
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,14 @@
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=21
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||||
org.eclipse.jdt.core.compiler.compliance=21
|
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||||
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||||
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
|
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
|
||||||
org.eclipse.jdt.core.compiler.release=enabled
|
org.eclipse.jdt.core.compiler.release=enabled
|
||||||
org.eclipse.jdt.core.compiler.source=21
|
org.eclipse.jdt.core.compiler.source=1.8
|
||||||
|
|
|
||||||
90
test
90
test
|
|
@ -1,90 +0,0 @@
|
||||||
import java.awt.BorderLayout;
|
|
||||||
import java.awt.EventQueue;
|
|
||||||
import java.awt.FlowLayout;
|
|
||||||
|
|
||||||
import javax.swing.JFrame;
|
|
||||||
import javax.swing.JPanel;
|
|
||||||
import javax.swing.border.EmptyBorder;
|
|
||||||
import javax.swing.JButton;
|
|
||||||
import javax.swing.JTextField;
|
|
||||||
import javax.swing.JLabel;
|
|
||||||
import javax.swing.JOptionPane;
|
|
||||||
import java.awt.event.ActionListener;
|
|
||||||
import java.awt.event.ActionEvent;
|
|
||||||
|
|
||||||
public class Exo extends JFrame {
|
|
||||||
|
|
||||||
private JPanel contentPane;
|
|
||||||
private JTextField textField;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Launch the application.
|
|
||||||
*/
|
|
||||||
public static void main(String[] args) {
|
|
||||||
EventQueue.invokeLater(new Runnable() {
|
|
||||||
public void run() {
|
|
||||||
try {
|
|
||||||
Exo frame = new Exo();
|
|
||||||
frame.setVisible(true);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create the frame.
|
|
||||||
*/
|
|
||||||
public Exo() {
|
|
||||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
||||||
setBounds(100, 100, 450, 150);
|
|
||||||
contentPane = new JPanel();
|
|
||||||
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
|
|
||||||
contentPane.setLayout(new BorderLayout(0, 0));
|
|
||||||
setContentPane(contentPane);
|
|
||||||
|
|
||||||
// Panel pour le champ de texte et le bouton
|
|
||||||
JPanel inputPanel = new JPanel();
|
|
||||||
inputPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
|
|
||||||
contentPane.add(inputPanel, BorderLayout.CENTER);
|
|
||||||
|
|
||||||
// Label pour l'instruction
|
|
||||||
JLabel instructionLabel = new JLabel("Entrez une année :");
|
|
||||||
inputPanel.add(instructionLabel);
|
|
||||||
|
|
||||||
// Champ de texte
|
|
||||||
textField = new JTextField();
|
|
||||||
inputPanel.add(textField);
|
|
||||||
textField.setColumns(10);
|
|
||||||
|
|
||||||
// Bouton "Calculer"
|
|
||||||
JButton btnNewButton = new JButton("Calculer");
|
|
||||||
btnNewButton.addActionListener(new ActionListener() {
|
|
||||||
public void actionPerformed(ActionEvent e) {
|
|
||||||
clicB();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
inputPanel.add(btnNewButton);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void clicB() {
|
|
||||||
try {
|
|
||||||
// Récupérer l'année saisie
|
|
||||||
int year = Integer.parseInt(textField.getText());
|
|
||||||
|
|
||||||
// Vérifier si l'année est bissextile
|
|
||||||
boolean isLeapYear = (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0);
|
|
||||||
|
|
||||||
// Afficher le résultat dans une fenêtre pop-up
|
|
||||||
if (isLeapYear) {
|
|
||||||
JOptionPane.showMessageDialog(this, year + " est une année bissextile.", "Résultat", JOptionPane.INFORMATION_MESSAGE);
|
|
||||||
} else {
|
|
||||||
JOptionPane.showMessageDialog(this, year + " n'est pas une année bissextile.", "Résultat", JOptionPane.INFORMATION_MESSAGE);
|
|
||||||
}
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
// Gérer les erreurs si l'entrée n'est pas un nombre valide
|
|
||||||
JOptionPane.showMessageDialog(this, "Veuillez entrer une année valide.", "Erreur", JOptionPane.ERROR_MESSAGE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue