Carlos Delgado

Greenhorn
+ Follow
since Aug 17, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Carlos Delgado

Hi!

I'm not programming Java for a few months. Now I'm getting with Java again and I'm wondering how can I create an enumerated type.

I have an array and I want that the index can be a letter, this way:



Thanks!
18 years ago
Thanks Stan!
Your code was useful for knowing the current folder of the program. The problem is NetBeans. I got that the current dir is "C:\Program files\NetBeans\bin". I compiled the program in console mode and it works great.
So the problem is solved.

Thank you all!!
19 years ago
Is there a function which returns the current path of the program?? So I know if it's working in the correct folder or not... I know it seems a very newbie question: I'm a very newbie Java programmer...
Thank you again!
19 years ago
Hi all!
I'm having troubles reading a file which is in the current folder of the program.
I make the file and the stream, but if I specify the path as "file.ext" my program doesn't reads it: I have to specify the whole path as "C:\\MyProgram\\file.ext". I tried so "\\file.ext" but I got the same error.
I'm using netBeans. Could it be the problem? Does anyone know what's happening?

Thank you very much in advance!
19 years ago
Thanks, Michael! I got it working now!
19 years ago
Thanks for your reply!
But in the Sun Java help pages there are not examples of it... :'( I was trying to avoid those eternal readings without examples.
All I want is a little sample for changing focus between 3 JTextFields! Any ideas?
19 years ago
Hi all again!
I'm using a Swing application and I noticed that "NextFocusableComponent" is being deprecated and replaced by the "FocusTraversalPolicy".
Does anyone here know how does it work?? All I want is set an order for my controls when the TAB key is pressed.
Thanks!!
19 years ago
Thanks for the replies!
But is not there an easier method for comparing dates? With the Date type variables it's possible to do it easy, but working with Calendar I think it's a step back to calculate it in miliseconds...
19 years ago
Thanks for replying! I actually got it working now!
19 years ago

Originally posted by Dirk Schreckmann:
Carlos, are you still stuck?


No, thanks Dirk. I've already made what I needed.
19 years ago
Hi all!
I want to clear all the items of the list because depending on the option the user chooses I'm showing one kind of information or another.
I'm trying list.removeAll(). It doesn't work.
With the DefaultListModel associated to the JList I'm trying:
listModel.clear();
listModel.removeAllElements();
Even I'm trying to delete each element manually with listModel.removeElementAt(index);
These 3 statements crash if one element of the list is selected. I want to know if there's a way of clearing the list or deselecting the selected item...

Thanks!
19 years ago
Hi all again!
I began to make a program for a library that uses Date variables. I found out that the Date type is being deprecated as my compiler says. Si I'm updating it to Calendar.
But I have a few questions:
1. Can I translate a String to a Calendar?
2. Can I know the difference (in days) between to Calendar variables?
3. Can I display a Calendar as "07/09/04" instead of "Thu Aug 19 18:07:00 CEST 2004"?

As an example, if I rent a book on 29th, August 2004 and today is 4th, September 2004... is there a way to get 6 days? In all operations I'd like to bypass the time, only working with the date.

Thanks as always!
19 years ago

Originally posted by omar bili:
hi ,in the manifest you write
the name of the class that contains the main
method. in ur case : formulario
watch out for the spaces



Are you meaning that "Main-Class: formulario" should be wrong? Should it be "Main-Class:formulario"?
19 years ago
THANKS!!!
I've got this code in a BAT file:

I've got a folder with GIFs called "graficos" and another with the Exceptions called "errors".
As the command JAR creates the MANIFEST but not create the Main Class automatically I've got the external "MANIFEST.MF" with:

which is my main Swing class.
Is all OK?
Thanks again!
19 years ago
Hi all! I'm very newbie in Java. I got to do an application for my school where my teacher haven't teached us very well.
My application is finished but I want to know how to create a JAR file.
Is a JAR file an executable file? What's a manifest file?
I've got a main Swing form, several classes, a folder where I put the exception classes and another folder with images (gif).
I've searched in this forum but all questions about this are too complicated to me. I don't want a complicated one, just knowing how to do a simple one.
Thanks in advance!

(Sorry for my english. I'm spanish.)
19 years ago