Stuart Chambers

Greenhorn
+ Follow
since Feb 01, 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 Stuart Chambers

Thank you both Keith and Jim. This is exactly what I was after.

Stu...
18 years ago
I forgot to mention I tried using Collections.sort, however this sorts the strings in the same fashion as stated in the first list.
Stu...
18 years ago
I have an ArrayList of data which looks as follows:

"A"
"H"
"L1"
"L100"
"L11"
"L2"
"L3"
"X"

I would like to sort this ArrayList so that the numerical values are sorted correctly, such that the list looks like:

"A"
"H"
"L1"
"L2"
"L3"
"L11"
"L100"
"X"

Any suggestions would be greatly appreciated.
Stu...
18 years ago
I am trying to change some code that deals with a JTable and the contents of each cell in the first column.

Each cell in the first column contains a combo-box and the contents of these combo-boxes is setup via setCellEditor.

The problem I have is that this process sets the contents for EVERY combo-box in that column all at once. I would like to set each combo-box individually.

At the moment each cell gets set to with options {"Add", "Ignore", "Replace"}, but in some instances it is not correct to have "Replace" as an option and I'd like these rows to have the options {"Add", "Ignore"}.

I am at a loss as at the moment. I can only set the contents of every cell and would love to know if there is a way to deal with each cell individually.

Thanks,
Stu...
19 years ago
Hi Ropoty,
I am very new to Java also and have been working my way through the Sun Java Tutorial. It is free and can be done online or downloaded to your PC. Go to: http://java.sun.com/docs/books/tutorial/
Good luck, and happy coding.
[ February 17, 2004: Message edited by: Stuart Chambers ]
20 years ago
Hi Jaime,
I would modify your If statements and For loops in the following way (the code after the "\\close while loop" statement - I have removed the comments as you can add them back in as you require):

The If-Else structure ensures that once the code has been performed for the relevant selection, the following For loops are not performed as they are not necessary.
I hope this helps...
[ February 17, 2004: Message edited by: Stuart Chambers ]
20 years ago
If you want to generate a random number take alook at the following link:
http://www.javaranch.com/maha/Resources/gotchas_1_.html#RANDOM
This should contain all the info you need.
PS. This is my first posting, I hope it was useful.
20 years ago