Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Java] JFrame incorperation

Newbie Spellweaver
Joined
Apr 13, 2008
Messages
91
Reaction score
1
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.
 
Skilled Illusionist
Loyal Member
Joined
Jun 23, 2007
Messages
310
Reaction score
1
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.
 
Junior Spellweaver
Joined
Dec 30, 2006
Messages
124
Reaction score
0
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.
 
Newbie Spellweaver
Joined
Apr 13, 2008
Messages
91
Reaction score
1
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.
 
Back
Top