100 lines
3.8 KiB
Java
100 lines
3.8 KiB
Java
package gui;
|
|
|
|
/*
|
|
* To change this license header, choose License Headers in Project Properties.
|
|
* To change this template file, choose Tools | Templates
|
|
* and open the template in the editor.
|
|
*/
|
|
|
|
/**
|
|
* @author Louis Royer
|
|
* @author Flavien Haas
|
|
* @author JS Auge
|
|
*/
|
|
public class DownloadSelectionGen extends javax.swing.JPanel {
|
|
|
|
// Variables declaration - do not modify
|
|
private javax.swing.JButton jButton1;
|
|
private javax.swing.JLabel jLabel1;
|
|
private javax.swing.JList<String> jList1;
|
|
private javax.swing.JScrollPane jScrollPane1;
|
|
private static final long serialVersionUID = 13L;
|
|
private String[] listFilesToDownload;
|
|
// End of variables declaration
|
|
|
|
/**
|
|
* Creates new form ArgumentsGen
|
|
*/
|
|
public DownloadSelectionGen(String[] listFilesToDownload) {
|
|
this.listFilesToDownload = listFilesToDownload;
|
|
initComponents();
|
|
}
|
|
|
|
/**
|
|
* This method is called from within the constructor to initialize the form.
|
|
* WARNING: Do NOT modify this code. The content of this method is always
|
|
* regenerated by the Form Editor.
|
|
*/
|
|
@SuppressWarnings("unchecked")
|
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">
|
|
private void initComponents() {
|
|
|
|
jLabel1 = new javax.swing.JLabel();
|
|
jButton1 = new javax.swing.JButton();
|
|
jScrollPane1 = new javax.swing.JScrollPane();
|
|
jList1 = new javax.swing.JList<>();
|
|
|
|
jLabel1.setText("Select a file to download:");
|
|
|
|
jButton1.setText("Download");
|
|
jButton1.addActionListener(new java.awt.event.ActionListener() {
|
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
|
jButton1ActionPerformed(evt);
|
|
}
|
|
});
|
|
|
|
jList1.setModel(new javax.swing.AbstractListModel<String>() {
|
|
String[] strings = listFilesToDownload;
|
|
public int getSize() { return strings.length; }
|
|
public String getElementAt(int i) { return strings[i]; }
|
|
});
|
|
jScrollPane1.setViewportView(jList1);
|
|
jList1.setSelectedIndex(0);
|
|
|
|
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
|
this.setLayout(layout);
|
|
layout.setHorizontalGroup(
|
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addGroup(layout.createSequentialGroup()
|
|
.addContainerGap()
|
|
.addComponent(jLabel1)
|
|
.addGap(0, 0, Short.MAX_VALUE))
|
|
.addGroup(layout.createSequentialGroup()
|
|
.addGap(97, 97, 97)
|
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addContainerGap(104, Short.MAX_VALUE))
|
|
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
|
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
|
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 121, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addGap(23, 23, 23))
|
|
);
|
|
layout.setVerticalGroup(
|
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
|
.addGroup(layout.createSequentialGroup()
|
|
.addContainerGap()
|
|
.addComponent(jLabel1)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
|
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 134, javax.swing.GroupLayout.PREFERRED_SIZE)
|
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
|
.addComponent(jButton1)
|
|
.addContainerGap(24, Short.MAX_VALUE))
|
|
);
|
|
}// </editor-fold>
|
|
|
|
|
|
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
|
|
// TODO add your handling code here:
|
|
}
|
|
|
|
}
|