separation debug pas debug
This commit is contained in:
parent
ff7cdeb447
commit
8ce67f49d6
13 changed files with 70 additions and 270 deletions
|
@ -12,15 +12,30 @@ public class Main {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
||||||
//GestionnaireHistorique.instance().recuperer("z", "user");
|
// les méthode finnissant par 2 sont le double de celle sans 2, servant à tester en local
|
||||||
//on lance le server d'écoute de cmd
|
if (liste.Constante.debug) {
|
||||||
GestionnaireListeUtilisateur.instance().ecoute2(2002); //enlever le 2, debug //TODO PORT = 2001 à 2009
|
|
||||||
|
//on lance le server d'écoute de cmd
|
||||||
|
GestionnaireListeUtilisateur.instance().ecoute2(2001);
|
||||||
|
|
||||||
|
//on crée manuellement des utilisateurs //debug
|
||||||
|
GestionnaireListeUtilisateur.instance().envoie2("add$$$77$$$Moidebug$$$LocalHost$$$true");
|
||||||
|
|
||||||
|
//on met à jour notre liste
|
||||||
|
GestionnaireListeUtilisateur.instance().majListe2();
|
||||||
|
} else {
|
||||||
|
|
||||||
|
//on lance le server d'écoute de cmd
|
||||||
|
GestionnaireListeUtilisateur.instance().ecoute();
|
||||||
|
|
||||||
|
//on crée manuellement des utilisateurs
|
||||||
|
GestionnaireListeUtilisateur.instance().envoie("add$$$77$$$Moi$$$LocalHost$$$true");
|
||||||
|
|
||||||
|
//on met à jour notre liste
|
||||||
|
GestionnaireListeUtilisateur.instance().majListe();
|
||||||
|
}
|
||||||
|
|
||||||
//on crée manuellement des utilisateurs //debug
|
|
||||||
GestionnaireListeUtilisateur.instance().envoie2("add$$$77$$$Moi$$$LocalHost$$$true");
|
|
||||||
|
|
||||||
//on met à jour notre liste
|
|
||||||
GestionnaireListeUtilisateur.instance().majListe2(); //enlever le 2 //TODO
|
|
||||||
|
|
||||||
// on Subscribe à la servlet
|
// on Subscribe à la servlet
|
||||||
try {
|
try {
|
||||||
|
|
16
Projet_POO/src/liste/Constante.java
Normal file
16
Projet_POO/src/liste/Constante.java
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
package liste;
|
||||||
|
|
||||||
|
|
||||||
|
public class Constante {
|
||||||
|
|
||||||
|
public static final String IP_BROADCAST = "255.255.255.255";
|
||||||
|
public static final int SIZE_ORDRE = 100;
|
||||||
|
public static final int NUM_PORT_SERVER = 2000;
|
||||||
|
|
||||||
|
|
||||||
|
public static final String URL_SERVLET = "https://srv-gei-tomcat.insa-toulouse.fr/Servlet_MBP3/";
|
||||||
|
public static final String URL_SERVLET2 = "http://localhost:8080/Servlet_MBP/test";
|
||||||
|
|
||||||
|
|
||||||
|
public static final boolean debug = true; // indique si l'on debug en local sur un seul ordinateur
|
||||||
|
}
|
|
@ -1,12 +0,0 @@
|
||||||
package liste;
|
|
||||||
|
|
||||||
|
|
||||||
public class ConstanteListeUtilisateur {
|
|
||||||
|
|
||||||
public static final String IP_BROADCAST = "255.255.255.255";
|
|
||||||
public static final int SIZE_ORDRE = 100;
|
|
||||||
public static final int NUM_PORT_SERVER = 2000;
|
|
||||||
public static final int NUM_PORT_SERVER2 = 2001;
|
|
||||||
|
|
||||||
public static final String URL_SERVLET = "http://localhost:8080/Servlet_MBP/test";
|
|
||||||
}
|
|
|
@ -55,7 +55,7 @@ public class GestionnaireListeUtilisateur {
|
||||||
|
|
||||||
//ecoute le port de broadcast pour recevoir le message personnalisé
|
//ecoute le port de broadcast pour recevoir le message personnalisé
|
||||||
public void ecoute() { //static ??
|
public void ecoute() { //static ??
|
||||||
Thread ecouteThread = new Thread(new UdpBroadcastServer(ConstanteListeUtilisateur.NUM_PORT_SERVER));
|
Thread ecouteThread = new Thread(new UdpBroadcastServer(Constante.NUM_PORT_SERVER));
|
||||||
ecouteThread.start();
|
ecouteThread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,14 +67,14 @@ public class GestionnaireListeUtilisateur {
|
||||||
|
|
||||||
//envoie en Broadcast aux autres liste les infos sur cet utilisateur
|
//envoie en Broadcast aux autres liste les infos sur cet utilisateur
|
||||||
public void envoie(String message) {
|
public void envoie(String message) {
|
||||||
Thread envoieThread = new Thread(new UdpBroadcastClient(ConstanteListeUtilisateur.NUM_PORT_SERVER, message));
|
Thread envoieThread = new Thread(new UdpBroadcastClient(Constante.NUM_PORT_SERVER, message));
|
||||||
envoieThread.start();
|
envoieThread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
//debug local
|
//debug local
|
||||||
public void envoie2(String message) {
|
public void envoie2(String message) {
|
||||||
for(int i=0; i<10; i++) {
|
for(int i=0; i<10; i++) {
|
||||||
Thread envoieThread = new Thread(new UdpUnicastClient(ConstanteListeUtilisateur.NUM_PORT_SERVER + i, "LocalHost", message));
|
Thread envoieThread = new Thread(new UdpUnicastClient(Constante.NUM_PORT_SERVER + i, "LocalHost", message));
|
||||||
envoieThread.start();
|
envoieThread.start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,12 @@ public class TraitementCmdListe implements Runnable{
|
||||||
String statut = cmd[4];
|
String statut = cmd[4];
|
||||||
|
|
||||||
if (ordre.equals("listRequest")) {
|
if (ordre.equals("listRequest")) {
|
||||||
for (int i = 2000; i<2010; i++) envoyerNom2(i); // à changer, debug //TODO
|
if (liste.Constante.debug) {
|
||||||
//envoyerNom();
|
for (int i = 2000; i<2010; i++) envoyerNom2(i);
|
||||||
|
} else {
|
||||||
|
envoyerNom();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
semaphore.acquireUninterruptibly();
|
semaphore.acquireUninterruptibly();
|
||||||
|
|
|
@ -27,7 +27,7 @@ public class UdpBroadcastClient implements Runnable{
|
||||||
DatagramPacket datagramPacket = new DatagramPacket(
|
DatagramPacket datagramPacket = new DatagramPacket(
|
||||||
message.getBytes(),
|
message.getBytes(),
|
||||||
message.length(),
|
message.length(),
|
||||||
InetAddress.getByName(ConstanteListeUtilisateur.IP_BROADCAST),
|
InetAddress.getByName(Constante.IP_BROADCAST),
|
||||||
serverPort
|
serverPort
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ public class UdpBroadcastServer implements Runnable{
|
||||||
serverSocket = new DatagramSocket(serverPort);
|
serverSocket = new DatagramSocket(serverPort);
|
||||||
Semaphore semaphore = new Semaphore(1, true);
|
Semaphore semaphore = new Semaphore(1, true);
|
||||||
|
|
||||||
byte[] buffer = new byte[ConstanteListeUtilisateur.SIZE_ORDRE];
|
byte[] buffer = new byte[Constante.SIZE_ORDRE];
|
||||||
//serverSocket.setSoTimeout(3000);
|
//serverSocket.setSoTimeout(3000);
|
||||||
while (true) {
|
while (true) {
|
||||||
DatagramPacket datagramPacket = new DatagramPacket(buffer, 0, buffer.length);
|
DatagramPacket datagramPacket = new DatagramPacket(buffer, 0, buffer.length);
|
||||||
|
|
|
@ -8,7 +8,7 @@ public class Get {
|
||||||
|
|
||||||
//private static final String USER_AGENT = "Mozilla/5.0";
|
//private static final String USER_AGENT = "Mozilla/5.0";
|
||||||
|
|
||||||
private static final String GET_URL = liste.ConstanteListeUtilisateur.URL_SERVLET;
|
private static final String GET_URL = liste.Constante.URL_SERVLET;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import java.net.URL;
|
||||||
|
|
||||||
public class Post {
|
public class Post {
|
||||||
|
|
||||||
private static final String POST_URL = liste.ConstanteListeUtilisateur.URL_SERVLET;
|
private static final String POST_URL = liste.Constante.URL_SERVLET;
|
||||||
|
|
||||||
public static void sendPOST(String msg) throws IOException { // Publish cmd : change$$$id$$$nom$$$ip$$$dedans$$$statut
|
public static void sendPOST(String msg) throws IOException { // Publish cmd : change$$$id$$$nom$$$ip$$$dedans$$$statut
|
||||||
URL obj = new URL(POST_URL);
|
URL obj = new URL(POST_URL);
|
||||||
|
|
|
@ -89,7 +89,7 @@ public class ListUI extends JFrame implements Runnable{
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.out.println("Erreur : run ListUI2");
|
System.out.println("Erreur : run ListUI");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
dispose();
|
dispose();
|
||||||
}
|
}
|
||||||
|
@ -208,7 +208,13 @@ public class ListUI extends JFrame implements Runnable{
|
||||||
public void windowClosing(java.awt.event.WindowEvent windowEvent) {
|
public void windowClosing(java.awt.event.WindowEvent windowEvent) {
|
||||||
ListUI window = (ListUI) windowEvent.getSource();
|
ListUI window = (ListUI) windowEvent.getSource();
|
||||||
|
|
||||||
GestionnaireNom.instance().supprimer2(); //TODO enlever 2 //debug
|
if (liste.Constante.debug) {
|
||||||
|
GestionnaireNom.instance().supprimer2();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
GestionnaireNom.instance().supprimer();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// on envoie l'info au servlet
|
// on envoie l'info au servlet
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -223,7 +223,7 @@ public class Login_RegisterUI extends JFrame implements Runnable{
|
||||||
* Méthode
|
* Méthode
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Teste la validité des champs.
|
// Teste la validité des champs. //pour tester avant utilisation bdd
|
||||||
private void enter2() {
|
private void enter2() {
|
||||||
String id = idField.getText();
|
String id = idField.getText();
|
||||||
String pwd = String.valueOf(passwordField.getPassword());
|
String pwd = String.valueOf(passwordField.getPassword());
|
||||||
|
|
|
@ -133,12 +133,16 @@ public class NomUI extends JFrame implements Runnable{
|
||||||
else {
|
else {
|
||||||
//Sinon on essaye de prendre un nom
|
//Sinon on essaye de prendre un nom
|
||||||
if (GestionnaireNom.instance().verifierDisponibiliteNom(nom)) {
|
if (GestionnaireNom.instance().verifierDisponibiliteNom(nom)) {
|
||||||
//Celui-ci ne peut pas être "vide"
|
//Celui-ci ne peut pas être "vide" + protection cmd
|
||||||
if (!nom.isBlank() && !nom.contains("___")) {
|
if (!nom.isBlank() && !nom.contains("$$$")) {
|
||||||
|
|
||||||
boolean nouvelUtilisateur = (GestionnaireNom.instance().getNom() == null);
|
boolean nouvelUtilisateur = (GestionnaireNom.instance().getNom() == null);
|
||||||
|
if (liste.Constante.debug) {
|
||||||
|
GestionnaireNom.instance().nommer2(nom);
|
||||||
|
} else {
|
||||||
|
GestionnaireNom.instance().nommer(nom);
|
||||||
|
}
|
||||||
|
|
||||||
GestionnaireNom.instance().nommer2(nom); //enlever le 2 à la fin //TODO
|
|
||||||
// on envoie l'info à la servlet
|
// on envoie l'info à la servlet
|
||||||
try {
|
try {
|
||||||
if (nouvelUtilisateur) {
|
if (nouvelUtilisateur) {
|
||||||
|
|
|
@ -1,233 +0,0 @@
|
||||||
package ui;
|
|
||||||
|
|
||||||
import java.awt.EventQueue;
|
|
||||||
|
|
||||||
import javax.swing.JFrame;
|
|
||||||
import javax.swing.JOptionPane;
|
|
||||||
import javax.swing.JButton;
|
|
||||||
import java.awt.event.ActionListener;
|
|
||||||
import java.awt.event.ActionEvent;
|
|
||||||
import javax.swing.JTextField;
|
|
||||||
import javax.swing.JTextPane;
|
|
||||||
import javax.swing.JLabel;
|
|
||||||
import javax.swing.SpringLayout;
|
|
||||||
import java.awt.event.FocusAdapter;
|
|
||||||
import java.awt.event.FocusEvent;
|
|
||||||
import java.awt.event.MouseMotionAdapter;
|
|
||||||
import java.awt.event.MouseEvent;
|
|
||||||
import javax.swing.JComboBox;
|
|
||||||
import javax.swing.DefaultComboBoxModel;
|
|
||||||
import javax.swing.JCheckBox;
|
|
||||||
import javax.swing.JRadioButton;
|
|
||||||
import javax.swing.JToggleButton;
|
|
||||||
import javax.swing.JTextArea;
|
|
||||||
import javax.swing.JFormattedTextField;
|
|
||||||
import javax.swing.JPasswordField;
|
|
||||||
import javax.swing.JEditorPane;
|
|
||||||
import javax.swing.JSpinner;
|
|
||||||
import javax.swing.JTable;
|
|
||||||
import javax.swing.table.DefaultTableModel;
|
|
||||||
import javax.swing.JTree;
|
|
||||||
import javax.swing.tree.DefaultTreeModel;
|
|
||||||
import javax.swing.tree.DefaultMutableTreeNode;
|
|
||||||
import javax.swing.JProgressBar;
|
|
||||||
import javax.swing.JScrollBar;
|
|
||||||
import javax.swing.JSeparator;
|
|
||||||
import javax.swing.JSlider;
|
|
||||||
import javax.swing.JList;
|
|
||||||
import javax.swing.AbstractListModel;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// TEST ONLY
|
|
||||||
|
|
||||||
public class ToutUI {
|
|
||||||
|
|
||||||
private JFrame frmTitle;
|
|
||||||
private JTextField txtJtext;
|
|
||||||
private JPasswordField passwordField;
|
|
||||||
private JTable table;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Launch the application.
|
|
||||||
*/
|
|
||||||
public static void main(String[] args) {
|
|
||||||
EventQueue.invokeLater(new Runnable() {
|
|
||||||
public void run() {
|
|
||||||
try {
|
|
||||||
ToutUI window = new ToutUI();
|
|
||||||
window.frmTitle.setVisible(true);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create the application.
|
|
||||||
*/
|
|
||||||
public ToutUI() {
|
|
||||||
initialize();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize the contents of the frame.
|
|
||||||
*/
|
|
||||||
private void initialize() {
|
|
||||||
frmTitle = new JFrame();
|
|
||||||
frmTitle.setTitle("TITLE");
|
|
||||||
frmTitle.setBounds(100, 100, 620, 437);
|
|
||||||
frmTitle.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
||||||
frmTitle.getContentPane().setLayout(null);
|
|
||||||
|
|
||||||
JLabel lblNewLabel = new JLabel("New label");
|
|
||||||
lblNewLabel.setBounds(23, 24, 97, 14);
|
|
||||||
frmTitle.getContentPane().add(lblNewLabel);
|
|
||||||
|
|
||||||
txtJtext = new JTextField();
|
|
||||||
txtJtext.setText("jTextField");
|
|
||||||
txtJtext.setBounds(162, 21, 121, 20);
|
|
||||||
frmTitle.getContentPane().add(txtJtext);
|
|
||||||
txtJtext.setColumns(10);
|
|
||||||
|
|
||||||
JComboBox comboBox = new JComboBox();
|
|
||||||
comboBox.setMaximumRowCount(5);
|
|
||||||
comboBox.setModel(new DefaultComboBoxModel(new String[] {"1", "2", "3", "4", "5", "7", "8", "9", "10"}));
|
|
||||||
comboBox.setToolTipText("combo");
|
|
||||||
comboBox.setBounds(293, 20, 46, 22);
|
|
||||||
frmTitle.getContentPane().add(comboBox);
|
|
||||||
|
|
||||||
JButton btnNewButton = new JButton("New buttonn");
|
|
||||||
btnNewButton.addActionListener(new ActionListener() {
|
|
||||||
public void actionPerformed(ActionEvent arg0) {
|
|
||||||
}
|
|
||||||
});
|
|
||||||
btnNewButton.setToolTipText("tip");
|
|
||||||
btnNewButton.setMnemonic('e');
|
|
||||||
btnNewButton.setBounds(372, 20, 154, 23);
|
|
||||||
frmTitle.getContentPane().add(btnNewButton);
|
|
||||||
|
|
||||||
JCheckBox chckbxNewCheckBox = new JCheckBox("New check box");
|
|
||||||
chckbxNewCheckBox.setBounds(23, 60, 154, 23);
|
|
||||||
frmTitle.getContentPane().add(chckbxNewCheckBox);
|
|
||||||
|
|
||||||
JRadioButton rdbtnNewRadioButton = new JRadioButton("New radio button");
|
|
||||||
rdbtnNewRadioButton.setBounds(207, 60, 165, 23);
|
|
||||||
frmTitle.getContentPane().add(rdbtnNewRadioButton);
|
|
||||||
|
|
||||||
JToggleButton tglbtnNewToggleButton = new JToggleButton("New toggle button");
|
|
||||||
tglbtnNewToggleButton.setBounds(372, 60, 154, 23);
|
|
||||||
frmTitle.getContentPane().add(tglbtnNewToggleButton);
|
|
||||||
|
|
||||||
JTextArea txtrJtextarea = new JTextArea();
|
|
||||||
txtrJtextarea.setLineWrap(true);
|
|
||||||
txtrJtextarea.setText("JTextArea");
|
|
||||||
txtrJtextarea.setBounds(33, 90, 87, 55);
|
|
||||||
frmTitle.getContentPane().add(txtrJtextarea);
|
|
||||||
|
|
||||||
JFormattedTextField frmtdtxtfldJformattedtextfield = new JFormattedTextField();
|
|
||||||
frmtdtxtfldJformattedtextfield.setText("JFormattedTextField");
|
|
||||||
frmtdtxtfldJformattedtextfield.setBounds(163, 90, 154, 20);
|
|
||||||
frmTitle.getContentPane().add(frmtdtxtfldJformattedtextfield);
|
|
||||||
|
|
||||||
passwordField = new JPasswordField();
|
|
||||||
passwordField.setToolTipText("pwd");
|
|
||||||
passwordField.setBounds(384, 92, 98, 20);
|
|
||||||
frmTitle.getContentPane().add(passwordField);
|
|
||||||
|
|
||||||
JTextPane txtpnJtextpane = new JTextPane();
|
|
||||||
txtpnJtextpane.setText("JTextPane");
|
|
||||||
txtpnJtextpane.setBounds(481, 221, 97, 43);
|
|
||||||
frmTitle.getContentPane().add(txtpnJtextpane);
|
|
||||||
|
|
||||||
JEditorPane dtrpnJeditorpane = new JEditorPane();
|
|
||||||
dtrpnJeditorpane.setText("JEditorPane");
|
|
||||||
dtrpnJeditorpane.setBounds(471, 291, 107, 20);
|
|
||||||
frmTitle.getContentPane().add(dtrpnJeditorpane);
|
|
||||||
|
|
||||||
JSpinner spinner = new JSpinner();
|
|
||||||
spinner.setToolTipText("spinner");
|
|
||||||
spinner.setBounds(283, 125, 108, 20);
|
|
||||||
frmTitle.getContentPane().add(spinner);
|
|
||||||
|
|
||||||
table = new JTable();
|
|
||||||
table.setModel(new DefaultTableModel(
|
|
||||||
new Object[][] {
|
|
||||||
{null, null, null, null, null},
|
|
||||||
{null, null, null, null, null},
|
|
||||||
{null, null, null, null, null},
|
|
||||||
{null, null, null, null, null},
|
|
||||||
},
|
|
||||||
new String[] {
|
|
||||||
"New column", "New collllumn", "New column3", "New column", "New column"
|
|
||||||
}
|
|
||||||
));
|
|
||||||
table.setToolTipText("JTable");
|
|
||||||
table.setBounds(33, 154, 55, 64);
|
|
||||||
frmTitle.getContentPane().add(table);
|
|
||||||
|
|
||||||
JTree tree = new JTree();
|
|
||||||
tree.setToolTipText("tree");
|
|
||||||
tree.setModel(new DefaultTreeModel(
|
|
||||||
new DefaultMutableTreeNode("JTree") {
|
|
||||||
{
|
|
||||||
DefaultMutableTreeNode node_1;
|
|
||||||
node_1 = new DefaultMutableTreeNode("colors");
|
|
||||||
node_1.add(new DefaultMutableTreeNode("blue"));
|
|
||||||
node_1.add(new DefaultMutableTreeNode("violet"));
|
|
||||||
node_1.add(new DefaultMutableTreeNode("red"));
|
|
||||||
node_1.add(new DefaultMutableTreeNode("yellow"));
|
|
||||||
add(node_1);
|
|
||||||
node_1 = new DefaultMutableTreeNode("sports");
|
|
||||||
node_1.add(new DefaultMutableTreeNode("basketball"));
|
|
||||||
node_1.add(new DefaultMutableTreeNode("soccer"));
|
|
||||||
node_1.add(new DefaultMutableTreeNode("football"));
|
|
||||||
node_1.add(new DefaultMutableTreeNode("hockey"));
|
|
||||||
add(node_1);
|
|
||||||
node_1 = new DefaultMutableTreeNode("food");
|
|
||||||
node_1.add(new DefaultMutableTreeNode("hot dogs"));
|
|
||||||
node_1.add(new DefaultMutableTreeNode("pizza"));
|
|
||||||
node_1.add(new DefaultMutableTreeNode("ravioli"));
|
|
||||||
node_1.add(new DefaultMutableTreeNode("bananas"));
|
|
||||||
add(node_1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
));
|
|
||||||
tree.setBounds(131, 154, 104, 130);
|
|
||||||
frmTitle.getContentPane().add(tree);
|
|
||||||
|
|
||||||
JProgressBar progressBar = new JProgressBar();
|
|
||||||
progressBar.setValue(25);
|
|
||||||
progressBar.setToolTipText("progress");
|
|
||||||
progressBar.setBounds(293, 179, 146, 14);
|
|
||||||
frmTitle.getContentPane().add(progressBar);
|
|
||||||
|
|
||||||
JScrollBar scrollBar = new JScrollBar();
|
|
||||||
scrollBar.setValue(10);
|
|
||||||
scrollBar.setBounds(557, 36, 17, 333);
|
|
||||||
frmTitle.getContentPane().add(scrollBar);
|
|
||||||
|
|
||||||
JSlider slider = new JSlider();
|
|
||||||
slider.setToolTipText("slider");
|
|
||||||
slider.setBounds(271, 221, 200, 26);
|
|
||||||
frmTitle.getContentPane().add(slider);
|
|
||||||
|
|
||||||
JLabel lblNewLabel_1 = new JLabel("JList : updtae needed, JSeparator : non compris ....");
|
|
||||||
lblNewLabel_1.setBounds(23, 361, 316, 14);
|
|
||||||
frmTitle.getContentPane().add(lblNewLabel_1);
|
|
||||||
|
|
||||||
JList list = new JList();
|
|
||||||
list.setModel(new AbstractListModel() {
|
|
||||||
String[] values = new String[] {"A", "B", "C"};
|
|
||||||
public int getSize() {
|
|
||||||
return values.length;
|
|
||||||
}
|
|
||||||
public Object getElementAt(int index) {
|
|
||||||
return values[index];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
list.setBounds(470, 140, 77, 76);
|
|
||||||
frmTitle.getContentPane().add(list);
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue