Ajout des travaux effectuer

This commit is contained in:
2024-12-09 11:53:11 +01:00
parent 05fac8d3ae
commit c4e97e13da
558 changed files with 67900 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.event.MouseWheelEvent;
import javax.swing.JComponent;
public class Playlist extends JComponent implements MouseWheelListener
{
int n = 0;
int x = 70;
protected void paintComponent(Graphics pinceau)
{
Graphics secondPinceau = pinceau.create();
if (this.isOpaque()) {
secondPinceau.setColor(this.getBackground());
secondPinceau.drawRect(0, 0, getWidth(), getHeight());
}
for(int i = 0 ; i <10 ; i++)
{
secondPinceau.setColor(Color.GRAY);
secondPinceau.fillOval(x+10, 130, 70, 70);
x = x+90;
}
for(int i = 0 ; i <n ; i++)
{
secondPinceau.setColor(Color.YELLOW);
secondPinceau.fillOval(x+10, 130, 70, 70);
x = x+90;
}
}
public Playlist(){
super();
}
}

View File

@@ -0,0 +1,18 @@
import javax.swing.*;
import java.awt.*;
public class TestPlaylist
{
public static void main(String[] args)
{
JFrame fenetre = new JFrame();
fenetre.setSize(1000, 300);
fenetre.setLocation(100, 100);
fenetre.setBackground(Color.GREY);
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Playlist p = new Playlist();
p.add();
fenetre.setVisible(true);
}
}

View File

@@ -0,0 +1,15 @@
import javax.swing.*;
import java.awt.*;
public class TestVolume
{
public static void main(String[] args)
{
JFrame fenetre = new JFrame();
fenetre.setSize(1000, 300);
fenetre.setLocation(100, 100);
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
fenetre.add(new Volume());
fenetre.setVisible(true);
}
}

View File

@@ -0,0 +1,44 @@
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.event.MouseWheelEvent;
import javax.swing.JComponent;
public class Volume extends JComponent implements MouseWheelListener
{
int x = 0;
int nbrClic = 0;
protected void paintComponent(Graphics pinceau)
{
Graphics secondPinceau = pinceau.create();
secondPinceau.setColor(Color.DARK_GRAY);
secondPinceau.fillRect(0,0,this.getWidth(), this.getHeight());
for(int i = 0 ; i < 10 ; i++)
{
secondPinceau.setColor(Color.GRAY);
secondPinceau.fillOval(x, 50, 70, 70);
x = x+60;
}
for(int i = 0 ; i < this.nbrClic ; i++)
{
secondPinceau.setColor(Color.YELLOW);
secondPinceau.fillOval(x, 50, 70, 70);
x = x+60;
}
}
public void mouseWheelMoved(MouseWheelEvent evenement)
{
this.nbrClic = evenement.getWheelRotation();
this.repaint();
if(this.nbrClic>=10){
nbrClic++;
}
if(this.nbrClic<=0){
nbrClic--;
}
}
public Volume(){
super();
}
}