Results 1 to 2 of 2

Thread: graphical ls

  1. #1
    viosDeveloper is offline Member
    Join Date
    Oct 2012
    Posts
    3
    Rep Power
    0

    Default graphical ls

    Hi everyone! I am writing what is write now a graphical linux ls program that I am going to use for another program. The code I have put together should work, but for some reason doesn't. Thanks in advance for your help.

    Java Code:
    import java.awt.*;
    import javax.swing.*;
    import java.io.*;
    
    public class DTSTestAnalyzer
    {
        public DTSTestAnalyzer()
        {
            createWindow();
        }
        
        public static void main(String[] args)
        {
            DTSTestAnalyzer dtsTestAnalyzer = new DTSTestAnalyzer();
        }
        
        public void createWindow()
        {
            JFrame frame = new JFrame("A+ Test Analyzer");
            int counter;
            
            counter = 0;
            
            while(counter <= 1)
            {
                JLabel textLabel = new JLabel("PLEASE PICK A COMPANY",SwingConstants.CENTER);
                File dir = new File("~/Desktop/DTSTestAnalyzer/A+TestAnalyzer");
                String line = "";
                
                File[] subDirs = dir.listFiles(new FileFilter()
                {
                    public boolean accept(File pathname)
                    {
                        return pathname.isDirectory();
                    }
                });
                
                for (File subDir : subDirs)
                {
                    line = line + subDir.getPath();
                }
                
                TextArea textArea = new TextArea(line,10,20);
                
                frame.getContentPane().add(textLabel, BorderLayout.CENTER);
                frame.add(textArea);
            }
    
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setLocationRelativeTo(null);
            frame.pack();
            frame.setSize(300, 300);
            frame.setVisible(true);
        }
    }

  2. #2
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    6

    Default Re: graphical ls

    should work, but for some reason doesn't
    That means nothing to us. What does't work about it? Runtime Errors? Compile time errors? Stack trace? what?

Similar Threads

  1. Getting set up for graphical programming
    By natdizzle in forum New To Java
    Replies: 2
    Last Post: 04-02-2012, 07:44 AM
  2. Using threads in a graphical program
    By jameskelly in forum New To Java
    Replies: 6
    Last Post: 11-28-2010, 03:52 PM
  3. Graphical Java Developer
    By ALATECjobs in forum Jobs Offered
    Replies: 2
    Last Post: 09-28-2009, 11:24 PM
  4. Graphical query
    By Alex j in forum Introductions
    Replies: 0
    Last Post: 04-07-2009, 06:48 AM
  5. Graphical Ftp client
    By Java Tip in forum java.net
    Replies: 0
    Last Post: 04-07-2008, 08:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •