Robin Trietsch

Greenhorn
+ Follow
since Apr 09, 2011
Robin likes ...
Eclipse IDE Chrome Java
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
6
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Robin Trietsch

Thanks for your replies. I do understand now how to use these commands.
12 years ago
Hi all,

I'm learning Java with the book HeadFirstJava, but I don't completely understand how you can compile with flags.
E.g.:

%cd MyProject/source
%javac -d ../classes com/headfirstjava/PackageExercise.java

Where do you enter this? I believe it's not in the actual code. They give a lot of flags in the book, but they don't tell you how to use them.

Hope someone can help. Thanks.
12 years ago
It worked! I tried it this morning and that was the solution! Thanks,
Robin
12 years ago
No, I don't clear the Vector before calling JList.setListData(). I'm going to try that tomorrow. Thanks for your reply, I think that's the solution!
12 years ago
Hi all,

I've a problem with 'refreshing' the JList. I"m using a Vector (which gets it's data from a database) to fill the JList and the JList is in a JScrollPane. I'm using a JFrame to show the JScrollPane.
My problem:
When I try to set the list data of the JList, it doesn't replace the list data which already was in the JList, but it just adds the new data (including the previous data) to the JList.
Here's an example.

JList showing the following data:
- One
- Two
- Three

Now, some new data is added to the Vector. I add 'four' to the vector. When I call JList.setListData(Vector) the JList shows this data:

- One
- Two
- Three
- One
- Two
- Three
- Four

I obviously only want the new data (one till four) and I want to get rid of the old data. Why doesn't the JList replace the previous data?

Hope someone can help me! (If you need my entire code, just leave a reply here. My code is very long, so I hope you don't need it )

Robin
12 years ago