-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileListListener.java
More file actions
37 lines (32 loc) · 885 Bytes
/
FileListListener.java
File metadata and controls
37 lines (32 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package Notes;
import javax.swing.JList;
import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
/**
*
* @author pokus
*/
public class FileListListener implements ListSelectionListener {
private Window window;
private Core core;
private JList<String> list;
int i = 0;
public FileListListener(Window w, Core core) {
this.window = w;
this.core = core;
}
@Override
public void valueChanged(ListSelectionEvent e) {
if (!e.getValueIsAdjusting()) {
window.setFrameTitle();
String[] path = window.getActualPath();
window.setFiles(core.getFiles(path[0]));
window.requestFocusInWindow();
}
}
}