Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Java 

Java extension changer / spoofer

Welcome to my first post on the HackFourms!
This will be a java tutorial on how to make a extension changer! I have written all the code myself and this is in fact only the second day I've been coding in java. To start I assume you have Eclipse and WindowBuilder Pro and the knowledge on how to use it.

Now lets get started! Open eclipse and make a new project, here is the dull and most tedious part I think, it's making the GUI. We do have WindowBuilder Pro but still it's kinda boring. 😕 Anyway you go to File->New->Java Project
Name it and then click Finish

Ok so we have a project, now we go to File->New->Other
[img]http://projectfreepc.co.uk/public_files/eclipse2.png[/img]

Now you go down the list and select what I have selected here, this will be the GUI of the application (if you don't have it you probably didn't install WindowBuilder Pro and you need to do that, this isn't a tutorial on how to install WindowBuilder Pro, there's plenty of tutorials on google)
[img]http://projectfreepc.co.uk/public_files/eclipse3.png[/img]

Now you build your GUI, or your interface. Make sure you're on the Design tab first obviously. 😝 This is my interface, whats going to be confusing for you is that I've renamed my things. But being the nice person I am I'll tell you what I've named them

First textField = textFilePath
Second textField = textFilename
Third textField = textCurrexten
Fourth textField = textNewexten
Status Label = lblStatus
[img]http://projectfreepc.co.uk/public_files/eclipse4.png[/img]


So after you made your GUI it's time for the fun part, the coding. 😁
Switch to the Source tab and there will be a ton of generated code from the GUI. Up at the top there should be a bunch of things with the word Private in front, add these lines of code there.
[img]http://projectfreepc.co.uk/public_files/eclipse5.PNG[/img]

Now go back to the Design form and double-click the browse button to browse for the file (it really doesn't matter what it's named) and add this code, oh by the way it's going to be in pictures, no copying and pasting 😠
[img]http://projectfreepc.co.uk/public_files/eclipse6.png[/img]

We see here we make a file chooser (like openfiledialog). Then we make a File named F and set it to the C:\ directory, then we make an integer to check what the user chooses on the file chooser, for example if they click cancel nothing will happen because we put in the if statement.
If you get errors, hover over the error and there should be a option to Import something, click on it and it will auto-import it and the errors should be gone; if you're still having a problem here is a picture of my imports
[img]http://projectfreepc.co.uk/public_files/eclipse7.png[/img]

Now that we have that, go back to Design and double-click on the ok button, or whatever button you made that will change the extension. Then add this code here. (Yes I know that one line goes way off the page but I'll allow you to copy and paste that)
[img]http://projectfreepc.co.uk/public_files/eclipse8.png[/img]

Here is that line of code that went off the page -
Code
File file2 = new File(NameDir + "/" + textFilename.getText() + textCurrexten.getText() + "." + textNewexten.getText() + "." + textCurrexten.getText());

That's pretty much it! Here [was going to be] some screenshots of my finished program! [until I ran out of image space]

Now we need to make it into a executable jar, so go to File->Export

Then select Jar in the Java category
[img]http://projectfreepc.co.uk/public_files/eclipse10.png[/img]

Press next then MAKE SURE YOU CHECK YOUR PROJECT! THIS IS IMPORTANT!
[img]http://projectfreepc.co.uk/public_files/eclipse11.png[/img]

Press next and choose your main class, THIS IS ALSO SUPER IMPORTANT IF YOU WANT THE FILE TO BE ABLE TO RUN! I've neglected to do this a few times and wondered why my program wouldn't run.
[img]http://projectfreepc.co.uk/public_files/eclipse12.png[/img]

Then click finish and boom! It saved (don't worry about the warnings it will still run)

This was my first ever post to the HackForums! Tell me what you think 😁

Link to the program - Download
I just skimmed through this, but its a very HQ tutorial IMO.
Nice job. :)
o_o
(Sep 23, 2012 03:10 PM)Rubber Wrote:  I just skimmed through this, but its a very HQ tutorial IMO.
Nice job. :)

Thanks for that. I'm hoping to post some more stuff soon :)


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by Dinnemok34763Jun 23, 2018 10:25 PM 3 268 Jun 23, 2018 10:25 PM
Last Post: n0$f3ratu$
[Java] by Null.May 31, 2016 08:47 PM 5 539 May 31, 2016 08:47 PM
Last Post: JIM NASIUM'S GYMNASIUM
[.NET] by xeinebiuJan 12, 2016 02:14 PM 14 1,534 Jan 12, 2016 02:14 PM
Last Post: xeinebiu