Help me to resovle this problem

Dear friend:
Could you help me to this problem.I want to create a class.It can scan the specific directory to get the list of files in it.

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class SwingTrial1 extends JFrame {
     boolean inAnApplet = false;
     public SwingTrial1 () {
          Container contentpane = getContentPane();
          contentpane.add(new JFileChooser("Button 1 (North)"),BorderLayout.NORTH);
          addWindowListener(new WindowAdapter() {
               public void windowClosing(WindowEvent e) {
                    System.exit(0);
     public static void main(String[] args) {
          SwingTrial st = new SwingTrial();
          st.setTitle("SwingTrial");
          st.pack();
          st.setVisible(true);
}

Similar Messages

Maybe you are looking for