Jim Stevens

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

Recent posts by Jim Stevens

Jeff Verdegan wrote:Is this question different than your other thread?



No this thread was a completely different question that I solved by adding break statements and walking through my program to diagnose my problems...
12 years ago
I have done the searches. That is the reason I came to these forums. I am not looking for answer but maybe some guidance or explanation in english on how they work a little more....
12 years ago
I understand how it works. But i can't simply say 01<02. That does not work. How do I compare to object without using <>or =??? and in the sort method would i do if(compareTo(temp1,temp2) = -1??? thank you
12 years ago
This code does exactly what I want it to, but I would like to know how to code a compareTo method to use in my method that sorts and array of strings. Ive read up on the comparable class and compareTo and cant figure it out to save my life. thank you

12 years ago
solved...



needed to put the -1 on end
12 years ago
Ya I found that right after i posted it. My next problem is

Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 16, Size: 16
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at Sort.sortArray(Sort.java:50)
at Sort.main(Sort.java:23)

my switch statements are causing some kind of index out of bounds....
12 years ago
So my assignment/goal is to great a static generic method to sort an arraylist of objects that implements comparable that sorts an array in ascending order. I have some code written up. My problem is when I get user input and run my code it does not sort my arraylist. I get no errors. It just spits out the array in the order they were entered. I feel like my problem is in the generic method. Any help or pointers would be great. Thanks

12 years ago

Campbell Ritchie wrote:That is just an example. You can't display a Panel unless you have a top-level container to add it to.


Im aware my JPanel works fine.
12 years ago

davidb smith wrote:



Already tried doesn't seem to work...
12 years ago

Devaka Cooray wrote:Did you mean that you want to pass that 'man' object to GUIpanel2 class?



yes
12 years ago
So I have a question. I need to create and instance of CardManager. Which I do here.

I need to know how to pass the instance to a constructor in my GUI class.



thank you
12 years ago
solved
if(name.getText()!= null) needs to be

if(name.getText().length != 0)
12 years ago
quick question Pual. I use this code to disable to button but it doesnt seem to work....

12 years ago
Quick question... I have a JButton action listener. Inside the action listener when I press the open account button it takes the name entered into the JTextField and opens a Bank account with the name. My question is when the GUI is opened and I press the Open account button before actually putting input into the name textfield, It throws and illegalargumentexception and the program is unusable unless i restart it. How to I avoid this. I have tryed to do a dowhile loop but that doesnt seem to work. I have a try catch but it doesnt seem to work either. THANK YOU.

12 years ago
Haha thank you. Got it running beautifully. I overlooked that semicolon.
12 years ago