PDA

View Full Version : Renameing Files (Question)



Noxious020189
01-19-2006, 07:16 PM
Ok, I have the basic layout of the program that I'm makeing, but I can not figure out for my life how to rename files. I want it to rename like 5,000 files by numbering it like 1.psd, 2.psd, 3.psd, 4.psd, and so on...This is for my art section of my computer I'm sick of haveing files saying like tjasdf1.png, and then it's all unorganized and YUK! anyways heres what I have:

http://img297.imageshack.us/img297/1365/untitled11xq.gif

1- This button to link to another form. Which Form2 would display many formats of pictures like .bmp, .png, .gif, .psd, and so on... Then when they click on one I want there to be a message box that asks the user weather there sure.
2- This button will link to another form.
3- This button will link to another form.
4- This button will exit the program.
5- This is a section where the user can keep notes.

What I need to know is for number 1.

I already know in the help section it will say that it is mandatory for you to make a directory called "Render" in your C:\, so what I need to know when the user clicks on one of the choices how do I make that pop-up a message box, and then if they hit no exits them back to the selction area, but if they hit yes it will relable them 1, 2, 3, and so on?

cx323
01-19-2006, 07:48 PM
here's a project i did with renaming in vb a while ago. it should help you

Noxious020189
01-19-2006, 07:51 PM
here's a project i did with renaming in vb a while ago. it should help you

Im a true noob at this, cause Im use to typeing it all in and getting it taught to me. This I have not been taight yet, so if you can explain to me what and how I would be greatfull

cx323
01-19-2006, 07:58 PM
what part didn't you understand?

Hell-Fire
01-27-2006, 09:44 AM
What programming language are we talking about here?

I wrote a very similiar program for GlaxoSmithKline to handle their international emailing list reductions.

eshbach
01-27-2006, 09:45 PM
What programming language are we talking about here?

I wrote a very similiar program for GlaxoSmithKline to handle their international emailing list reductions.

looking at the picture, i'd say it has a 90% chance of being...

VB6 :(

just kidding, i don't mean to rip on vb if it does what you need it to do.

Hell-Fire
01-29-2006, 08:24 AM
looking at the picture, i'd say it has a 90% chance of being...

VB6 :(

just kidding, i don't mean to rip on vb if it does what you need it to do.


LOL. I did miss the "Form1" title at the top of the GUI.

I have seen some really generic Java GUIs that look just like that. ;)
Ask any first year Computer Science major and I am betting they have seen stuff just like that in their first or second class labs.

eshbach
01-29-2006, 01:41 PM
LOL. I did miss the "Form1" title at the top of the GUI.

I have seen some really generic Java GUIs that look just like that. ;)
Ask any first year Computer Science major and I am betting they have seen stuff just like that in their first or second class labs.

In a basic JAVA gui the buttons wouldn't be spaced out like that. The layout manager will put the buttons fairly close to each other, and they will all be a uniform size.

it would look something like this:

http://info.borland.com/techpubs/jbuilder/jbuilder2005/designui/images/gridlayout.gif

or

http://www.java2s.com/images/FlowLayout1.PNG

Hell-Fire
01-29-2006, 02:01 PM
Not if you use empty JLabels they wouldnt. Thats a good way to get seperation.

eshbach
01-29-2006, 04:14 PM
Not if you use empty JLabels they wouldnt. Thats a good way to get seperation.

what you mean adding blank labels into the layout to make space? :stick:

Hell-Fire
01-29-2006, 05:04 PM
If you want space between buttons versus them all jammed up together you can add a JLabel between them in the GUI constructor.

JButton button1 = new JButton("I Love eshbach");
JButton button2 = new JButton("he is my hero");
JLabel label = new JLabel(""):

GridLayout test = new GridLayout(1,3);
test.add(button1);
test.add(label);
test.add(button2);

etc etc etc. You can also use JTextFields that are set to setEditable(False) and stick those between buttons. There is a more complex way to do it, but of course we are talking generics here.

eshbach
01-29-2006, 05:38 PM
If you want space between buttons versus them all jammed up together you can add a JLabel between them in the GUI constructor.

JButton button1 = new JButton("I Love eshbach");
JButton button2 = new JButton("he is my hero");
JLabel label = new JLabel(""):

GridLayout test = new GridLayout(1,3);
test.add(button1);
test.add(label);
test.add(button2);

etc etc etc. You can also use JTextFields that are set to setEditable(False) and stick those between buttons. There is a more complex way to do it, but of course we are talking generics here.

yea, that's what i thought you meant.

while that probably works ok, the correct way to do what you're suggesting is buy using a GridBagLayout and setting the appropriate constraints on the elements of the container.

Hell-Fire
01-29-2006, 08:22 PM
yea, that's what i thought you meant.

while that probably works ok, the correct way to do what you're suggesting is buy using a GridBagLayout and setting the appropriate constraints on the elements of the container.

Of course thats the correct/better way to do it. I was recommending something that would be easier for the beginning programmer.

The GridBagLayout takes more work and expertise to use properly than a standard (Grid, Border, Flow) layout.