Re: Array info



Bigval wrote:
I have a gui, in which i want to make my comboboxes more dynamic.

I have created a Cpu class that has a number of params, including a
String name.

I want the combobox to store an array of these names.

I have an array of type Cpu, so how do i go about extracting the names
from the Cpu objects to put them into the combobox? (i have written a
getName method in the Cpu class).

currently this code produces an array of memory addresses:

cpuList[0] = cpu1;
cpuList[1] = cpu2;
cpuList[2] = cpu3;
String []cpuComboList = new String [cpuList.length];

for (int i = 0; i < cpuList.length; i++){
cpuComboList[i] = cpuList[i].getName(cpuList[i]);
}
cpuList is initialised as are the cpu objects.

John

// --- remove listeners from yourComboBox if it has
yourComboBox.removeAllItems();
for (int i = 0; i < cpuList.length; i++){
yourComboBox.addItem(cpuList[i].getName());
}
// --- add listeners to yourComboBox if it had
.



Relevant Pages

  • linux-next: x86_64 does not boot in Qemu
    ... 66c38e394e8c178c806266bb213f1087cd182701 is first bad commit ... Remove the boot_cpu_pda array and pointer table from the data section. ... will reallocate the pda in node local memory and if the cpu is being ... the x86_64 kernel stopped booting for me. ...
    (Linux-Kernel)
  • [patch 06/10] SLUB: Place kmem_cache_cpu structures in a NUMA aware way.
    ... The kmem_cache_cpu structures introduced are currently an array placed in the ... of pointers to kmem_cache_cpu structs in kmem_cache (similar to SLAB). ... We would like to put per cpu structures for the same cpu but different ... Dense packing of per cpu structures reduces cacheline ...
    (Linux-Kernel)
  • [patch 5/6] SLUB: Place kmem_cache_cpu structures in a NUMA aware way
    ... The kmem_cache_cpu structures introduced are currently an array placed in the ... of pointers to kmem_cache_cpu structs in kmem_cache (similar to SLAB). ... We would like to put per cpu structures for the same cpu but different ... Dense packing of per cpu structures reduces cacheline ...
    (Linux-Kernel)
  • Re: Array info
    ... String name. ... I want the combobox to store an array of these names. ... I have an array of type Cpu, so how do i go about extracting the names ... the toStringmethod in your Cpu class. ...
    (comp.lang.java.help)
  • [patch 1/7] allocpercpu: Make it a true per cpu allocator by allocating from a per cpu array
    ... Currently each call to alloc_percpu allocates an array of pointer to objects. ... itself for each and every per cpu array in use. ... but the freeing and allocation of the per cpu areas no longer needs to ...
    (Linux-Kernel)