DirectoryTableApp.java
Dosyayı İndir
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
public class DirectoryTableApp extends JFrame{
public DirectoryTableApp(){
setBounds(10,10,300,300);
File directory=new File("/");
File directoryIcon =new File("/Users/zaferteker/Private/Books/Projects/Javascript/plus.gif");
File normalIcon =new File("/Users/zaferteker/Private/Books/Projects/Javascript/open.gif");
DirectoryTable table=new DirectoryTable(directory, directoryIcon, normalIcon);
JButton button=new JButton("Yukarı");
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
table.up();
}
});
getContentPane().setLayout(new BorderLayout());
getContentPane().add(button,BorderLayout.NORTH);
getContentPane().add(new JScrollPane(table), BorderLayout.CENTER);
}
public static void main(String[] args) {
DirectoryTableApp p=new DirectoryTableApp();
p.setVisible(true);
}
}
Dosyayı İndir