Skip to content
Snippets Groups Projects
Commit 9fc20818 authored by LABOUREL Arnaud's avatar LABOUREL Arnaud
Browse files

Corrected files in order to pass checkstyle

parent f961f589
Branches
No related tags found
No related merge requests found
......@@ -8,8 +8,6 @@ plugins {
group 'fr.univ_amu'
version '1.0-SNAPSHOT'
checkstyle {
toolVersion = '10.3.4'
}
......@@ -19,14 +17,11 @@ repositories {
}
dependencies {
checkstyle "com.puppycrawl.tools:checkstyle:10.3.4"
testImplementation('org.junit.jupiter:junit-jupiter-api:5.9.0',
'org.assertj:assertj-core:3.23.1')
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.0'
}
test {
finalizedBy jacocoTestReport // report is always generated after tests run
}
......@@ -34,8 +29,6 @@ jacocoTestReport {
dependsOn test // tests are required to run before generating the report
}
test {
useJUnitPlatform()
}
......
package sample;
import javax.swing.*;
//import java.awt.*;
import javax.swing.JFrame;
public class MyJFrame extends JFrame{
public MyJFrame(){
/**
* An extended version of javax.swing.JFrame containing a panel to draw images.
*/
public class MyJavaFrame extends JFrame {
/**
* Constructs a new visible frame.
*/
public MyJavaFrame() {
setTitle("Main window");
setSize(400, 400);
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
add(new MyJPanel());
add(new MyJavaPanel());
setVisible(true);
}
public static void main(String[] args) {
MyJFrame app = new MyJFrame();
new MyJavaFrame();
}
}
package sample;
import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.Objects;
import javax.imageio.ImageIO;
import javax.swing.JPanel;
public class MyJPanel extends JPanel {
/**
* An extension of javax.swing.JFrame that can draw images.
*/
public class MyJavaPanel extends JPanel {
private BufferedImage image;
/**
* Constructs a new panel that draw an image.
*/
public MyJPanel() {
public MyJavaPanel() {
try {
image = ImageIO.read(getClass().getResource("image.png"));
image = ImageIO.read(Objects.requireNonNull(getClass().getResource("image.png")));
} catch (IOException ex) {
System.out.println("problem! image can't be loaded!");
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment