Click here to Skip to main content
15,921,113 members
Home / Discussions / Java
   

Java

 
GeneralRe: A Collection is not thread-safe? Pin
Richard MacCutchan28-Sep-10 21:23
mveRichard MacCutchan28-Sep-10 21:23 
QuestionThreads and UML Pin
Neo1010127-Sep-10 6:27
Neo1010127-Sep-10 6:27 
AnswerRe: Threads and UML Pin
DaveAuld27-Sep-10 9:57
professionalDaveAuld27-Sep-10 9:57 
GeneralRe: Threads and UML Pin
David Skelly27-Sep-10 22:50
David Skelly27-Sep-10 22:50 
GeneralRe: Threads and UML Pin
DaveAuld27-Sep-10 23:58
professionalDaveAuld27-Sep-10 23:58 
AnswerRe: Threads and UML Pin
David Skelly27-Sep-10 22:59
David Skelly27-Sep-10 22:59 
QuestionArrayList Pin
future383927-Sep-10 2:28
future383927-Sep-10 2:28 
AnswerRe: ArrayList Pin
Cedric Moonen27-Sep-10 2:47
Cedric Moonen27-Sep-10 2:47 
1) You probably don't want to create your list in the insert method: if you do so, you will create a new list each time the insert method is called (and I guess it's not what you want). So, preferably make it a member of your DataInteraction class (and create it in the constructor of the class).

2) It's a bit strange that you call the class Items and not Item. Is this class supposed to represent multiple items or only one ? From your code, I guess it should be called Item.

3) I guess you want to store several items in your array list. If so, simply create an instance of the Item class when you call the insert method and add the object to the list:

public class dataInteraction{   
   public static insert(int id, String model, String type, String name, String description, String craetor, Date created )    {        
      Item newItem = new Item(id, model, type, name, description, creator, created);
      arrayList.add(newItem);                      
   }
}

Cédric Moonen
Software developer

Charting control [v3.0]
OpenGL game tutorial in C++

GeneralRe: ArrayList Pin
future383927-Sep-10 3:25
future383927-Sep-10 3:25 
GeneralRe: ArrayList Pin
Cedric Moonen27-Sep-10 4:36
Cedric Moonen27-Sep-10 4:36 
GeneralRe: ArrayList Pin
Richard MacCutchan27-Sep-10 5:41
mveRichard MacCutchan27-Sep-10 5:41 
GeneralRe: ArrayList Pin
Cedric Moonen27-Sep-10 7:44
Cedric Moonen27-Sep-10 7:44 
GeneralRe: ArrayList Pin
Luc Pattyn27-Sep-10 8:44
sitebuilderLuc Pattyn27-Sep-10 8:44 
GeneralRe: ArrayList Pin
David Skelly27-Sep-10 22:47
David Skelly27-Sep-10 22:47 
GeneralRe: ArrayList Pin
Luc Pattyn28-Sep-10 2:14
sitebuilderLuc Pattyn28-Sep-10 2:14 
GeneralRe: ArrayList Pin
David Skelly28-Sep-10 3:16
David Skelly28-Sep-10 3:16 
GeneralRe: ArrayList Pin
Richard MacCutchan27-Sep-10 21:36
mveRichard MacCutchan27-Sep-10 21:36 
GeneralRe: ArrayList Pin
Nagy Vilmos28-Sep-10 1:45
professionalNagy Vilmos28-Sep-10 1:45 
GeneralRe: ArrayList Pin
Richard MacCutchan28-Sep-10 2:18
mveRichard MacCutchan28-Sep-10 2:18 
QuestionHow to implement normal Table control with GEF? Pin
sinron26-Sep-10 21:45
sinron26-Sep-10 21:45 
QuestionHow to refresh JTable of Frame one on close of Frame two Pin
Alok Sharma ji26-Sep-10 21:29
Alok Sharma ji26-Sep-10 21:29 
AnswerRe: How to refresh JTable of Frame one on close of Frame two Pin
David Skelly27-Sep-10 22:40
David Skelly27-Sep-10 22:40 
QuestionDefault form Pin
future383926-Sep-10 17:12
future383926-Sep-10 17:12 
AnswerRe: Default form Pin
David Skelly27-Sep-10 22:38
David Skelly27-Sep-10 22:38 
Questionjava VS javafx Pin
future383926-Sep-10 15:33
future383926-Sep-10 15:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.