[Java] JFrame incorperation

Results 1 to 5 of 5
  1. #1
    Infraction Banned Matty is offline
    Grand MasterRank
    Apr 2008 Join Date
    TexasLocation
    580Posts

    [Java] JFrame incorperation

    My friend made me a program for my dad's office that takes all their files in a directory and organizes them by the last modified date. I was wondering if I could incorporate the .class file into a basic JFrame instead of it running in a CMD. Here is a basic JFrame from my Java book.

    Code:
    import javax.swing.JFrame;
    
    class ShowAFrame {
       
        public static void main(String args[]) {
           JFrame myFrame = new JFrame ();
           String myTitle = "File Organizer";
    
           myFrame.setTitle(myTitle);
           myFrame.setSize(300, 300);
           myFrame.setDefaultCloseOperation
               (JFrame.EXIT_ON_CLOSE);
           myFrame.setVisible(true);
         }
    }
    I'm not sure if it will work with that, but anyways. The program in cmd asks for the directory and then it organizes that one.


  2. #2
    Infraction Banned Matty is offline
    Grand MasterRank
    Apr 2008 Join Date
    TexasLocation
    580Posts

    Re: [Java] JFrame incorperation

    Any help?

  3. #3
    Grand Master Daney is offline
    Grand MasterRank
    Jun 2007 Join Date
    1,110Posts

    Re: [Java] JFrame incorperation

    Sorry, I'm no good with Java but doesn't Windows have this already?

    In a folder click on "Date Modified" toolbar and it will be organised by date.

  4. #4
    Elite Member WhiteMoga is offline
    Member +Rank
    Dec 2006 Join Date
    At my computer deskLocation
    129Posts

    Re: [Java] JFrame incorperation

    Okay, basically, you can create a JTextField that takes the directory, and a JButton with an actionlistener to run the method that sorts the directory.

    Basically, add the method into the above class, and then setup a JTextField and go from there.

  5. #5
    Infraction Banned Matty is offline
    Grand MasterRank
    Apr 2008 Join Date
    TexasLocation
    580Posts

    Re: [Java] JFrame incorperation

    Quote Originally Posted by Daney View Post
    Sorry, I'm no good with Java but doesn't Windows have this already?

    In a folder click on "Date Modified" toolbar and it will be organised by date.
    It organizes them into years too, the archiver that is.



Advertisement