JComboBox Usage Question
Hi guys,
I have a JClient form which have two JComboBox (State and City). When the State combo box changes it's value, the City combo box's allowable values would change. Both combo boxes are based on database tables. How can I synchronize these two comboboxes, so when the first box changes its' value then the second box will requery the database and display a different set of allowable values?
Regards
Tony
Shailesh,
These are my code. With the LOV binding, the combox are binded to table but the city combo will not refresh it's lists after state combo change the value.
stateCombo.setModel(JUComboBoxBinding.createLovBinding(
panelBinding, stateCombo, "CustomerView", null,
"CustomerViewIter", new String[] {"StateId"}, "StateLookupView",
new String[] {"StateId"}, new String[] {"StateName"}, null, null));
cityCombo.setModel(JUComboBoxBinding.createLovBinding(
panelBinding, cityCombo, "CustomerView", null,
"CustomerViewIter", new String[] {"CityId"}, "CityLookupView",
new String[] {"CityId"}, new String[] {"CityName"}, null, null));
stateCombo.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
cityCombo.repaint();
}); From the datamodel you posted at the beginning, the lovVOname for the second combo should have been CityView1, or in other words you should pick the viewobject that is viewlinked to the master StateVO.
Here's how it works.
Once you select a state in the states vo, the viewlinked collection on the detail changes to reflect all cities for that state. The Lov combo should then 'redraw' it's list as a reaction to the rangeRefreshed event from BC4J for the detail VO.
Similar Messages
-
/ usage questions...
Hello.
I have 2 questions:
1. I have noticed that my / partition's used space increased by ~10M from the last time I've checked it, from 111M to 121M. What could be the cause of that? (see the info below...)
2. The output of df and du is not what I am expecting it to be. I.e. there are differences between the disk usage reported by these 2 commands on the / partition. What could be the cause of this? (see the info below...)
Any reply or any RTFM re-dirrectioning is appreciated.
TIA
Info:
[root@guns /]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/ide/host0/bus0/target0/lun0/part5
189M 121M 68M 65% /
none 235M 0 235M 0% /dev/shm
tmpfs 235M 4.0K 235M 1% /tmp
/dev/ide/host0/bus0/target0/lun0/part2
31M 5.2M 24M 18% /boot
/dev/ide/host0/bus0/target0/lun0/part6
2.4G 713M 1.7G 30% /usr
/dev/ide/host0/bus0/target0/lun0/part7
1.9G 374M 1.5G 20% /var
/dev/ide/host0/bus0/target0/lun0/part8
57G 35G 23G 62% /home
/dev/ide/host0/bus0/target0/lun0/part9
957M 486M 472M 51% /opt
[root@guns /]# ls
bin boot dev etc home lib mnt opt proc root sbin sys tmp udev usr var
[root@guns /]# du -sh bin/ dev/ etc/ lib/ mnt/ proc/ root/ sbin/ sys/ tmp/ udev/
2.8M bin/
0 dev/
5.5M etc/
64M lib/
0 mnt/
481M proc/
12M root/
5.2M sbin/
du: cannot access `sys/bus/pci/drivers/Intel(R) 830M/845G/852GM/855GM/865G Framebuffer Driver': No such file or directory
0 sys/
4.0K tmp/
0 udev/
Here's my dmesg output in case it helps...
Linux version 2.6.11.7-ARCH (root@earth) (gcc version 3.4.3) #1 SMP Sat Apr 9 13:37:54 PDT 2005
BIOS-provided physical RAM map:
BIOS-e820: 0000000000000000 - 000000000009fc00 (usable)
BIOS-e820: 000000000009fc00 - 00000000000a0000 (reserved)
BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 000000001dffc000 (usable)
BIOS-e820: 000000001dffc000 - 000000001dfff000 (ACPI data)
BIOS-e820: 000000001dfff000 - 000000001e000000 (ACPI NVS)
BIOS-e820: 00000000ffff0000 - 0000000100000000 (reserved)
0MB HIGHMEM available.
479MB LOWMEM available.
On node 0 totalpages: 122876
DMA zone: 4096 pages, LIFO batch:1
Normal zone: 118780 pages, LIFO batch:16
HighMem zone: 0 pages, LIFO batch:1
DMI 2.3 present.
ACPI: RSDP (v000 ASUS ) @ 0x000f6b10
ACPI: RSDT (v001 ASUS A7VI-VM 0x30303031 MSFT 0x31313031) @ 0x1dffc000
ACPI: FADT (v001 ASUS A7VI-VM 0x30303031 MSFT 0x31313031) @ 0x1dffc080
ACPI: BOOT (v001 ASUS A7VI-VM 0x30303031 MSFT 0x31313031) @ 0x1dffc040
ACPI: DSDT (v001 ASUS A7VI-VM 0x00001000 MSFT 0x0100000b) @ 0x00000000
ACPI: PM-Timer IO Port: 0xe408
Allocating PCI resources starting at 1e000000 (gap: 1e000000:e1ff0000)
Built 1 zonelists
Kernel command line: root=/dev/hda5 vga=773 ro
Local APIC disabled by BIOS -- you can enable it with "lapic"
mapped APIC to ffffd000 (013e3000)
Initializing CPU#0
PID hash table entries: 2048 (order: 11, 32768 bytes)
Detected 807.525 MHz processor.
Using pmtmr for high-res timesource
Console: colour dummy device 80x25
Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
Memory: 480548k/491504k available (4086k kernel code, 10360k reserved, 1236k data, 288k init, 0k highmem)
Checking if this processor honours the WP bit even in supervisor mode... Ok.
Calibrating delay loop... 1597.44 BogoMIPS (lpj=798720)
Security Framework v1.0.0 initialized
Capability LSM initialized
Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
CPU: After generic identify, caps: 0183f9ff c1c7f9ff 00000000 00000000 00000000 00000000 00000000
CPU: After vendor identify, caps: 0183f9ff c1c7f9ff 00000000 00000000 00000000 00000000 00000000
CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line)
CPU: L2 Cache: 64K (64 bytes/line)
CPU: After all inits, caps: 0183f9ff c1c7f9ff 00000000 00000020 00000000 00000000 00000000
Intel machine check architecture supported.
Intel machine check reporting enabled on CPU#0.
Enabling fast FPU save and restore... done.
Checking 'hlt' instruction... OK.
ACPI: setting ELCR to 0200 (from 0e00)
CPU0: AMD Duron(tm) Processor stepping 01
per-CPU timeslice cutoff: 182.83 usecs.
task migration cache decay timeout: 1 msecs.
SMP motherboard not detected.
Local APIC not detected. Using dummy APIC emulation.
Brought up 1 CPUs
CPU0 attaching sched-domain:
domain 0: span 1
groups: 1
domain 1: span 1
groups: 1
NET: Registered protocol family 16
PCI: PCI BIOS revision 2.10 entry at 0xf10c0, last bus=1
PCI: Using configuration type 1
mtrr: v2.0 (20020519)
ACPI: Subsystem revision 20050228
ACPI: Interpreter enabled
ACPI: Using PIC for interrupt routing
ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 9 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 7 9 *10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 7 *9 10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 6 7 *9 10 11 12 14 15)
ACPI: PCI Root Bridge [PCI0] (00:00)
PCI: Probing PCI hardware (bus 00)
PCI: Via IRQ fixup
ACPI: PCI Interrupt Routing Table [_SB_.PCI0._PRT]
ACPI: PCI Interrupt Routing Table [_SB_.PCI0.PCI1._PRT]
Linux Plug and Play Support v0.97 (c) Adam Belay
pnp: PnP ACPI init
pnp: PnP ACPI: found 12 devices
PnPBIOS: Disabled by ACPI PNP
SCSI subsystem initialized
PCI: Using ACPI for IRQ routing
** PCI interrupts are no longer routed automatically. If this
** causes a device to stop working, it is probably because the
** driver failed to call pci_enable_device(). As a temporary
** workaround, the "pci=routeirq" argument restores the old
** behavior. If this argument makes the device work again,
** please email the output of "lspci" to [email protected]
** so I can fix the driver.
pnp: 00:02: ioport range 0xe400-0xe47f could not be reserved
pnp: 00:02: ioport range 0xe800-0xe80f has been reserved
pnp: 00:02: ioport range 0xe200-0xe27f has been reserved
Simple Boot Flag at 0x3a set to 0x1
apm: BIOS version 1.2 Flags 0x03 (Driver version 1.16ac)
apm: overridden by ACPI.
VFS: Disk quotas dquot_6.5.1
Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
devfs: 2004-01-31 Richard Gooch ([email protected])
devfs: boot_options: 0x1
Installing knfsd (copyright (C) 1996 [email protected]).
SGI XFS with ACLs, security attributes, no debug enabled
SGI XFS Quota Management subsystem
Initializing Cryptographic API
Applying VIA southbridge workaround.
PCI: Disabling Via external APIC routing
vesafb: framebuffer at 0xf0000000, mapped to 0xde880000, using 1536k, total 32768k
vesafb: mode is 1024x768x8, linelength=1024, pages=41
vesafb: protected mode interface info at c000:7f88
vesafb: scrolling: redraw
vesafb: Pseudocolor: size=8:8:8:8, shift=0:0:0:0
Console: switching to colour frame buffer device 128x48
fb0: VESA VGA frame buffer device
ACPI: Power Button (FF) [PWRF]
ACPI: CPU0 (power states: C1[C1] C2[C2])
ACPI: Processor [CPU0] (supports 16 throttling states)
isapnp: Scanning for PnP cards...
isapnp: No Plug & Play device found
Linux agpgart interface v0.100 (c) Dave Jones
agpgart: Detected VIA Twister-K/KT133x/KM133 chipset
agpgart: Maximum main memory to use for agp memory: 409M
agpgart: AGP aperture is 64M @ 0xf8000000
[drm] Initialized drm 1.0.0 20040925
intelfb: Framebuffer driver for Intel(R) 830M/845G/852GM/855GM/865G chipsets
intelfb: Version 0.9.2
serio: i8042 AUX port at 0x60,0x64 irq 12
serio: i8042 KBD port at 0x60,0x64 irq 1
Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing disabled
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
Floppy drive(s): fd0 is 1.44M
FDC 0 is a post-1991 82077
RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize
loop: loaded (max 8 devices)
Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
spurious 8259A interrupt: IRQ7.
VP_IDE: IDE controller at PCI slot 0000:00:07.1
VP_IDE: chipset revision 6
VP_IDE: not 100% native mode: will probe irqs later
VP_IDE: VIA vt82c686b (rev 40) IDE UDMA100 controller on pci0000:00:07.1
ide0: BM-DMA at 0xd800-0xd807, BIOS settings: hda:DMA, hdb:DMA
ide1: BM-DMA at 0xd808-0xd80f, BIOS settings: hdc:DMA, hdd:pio
Probing IDE interface ide0...
hda: Maxtor 6Y080L0, ATA DISK drive
hdb: HL-DT-ST GCE-8481B, ATAPI CD/DVD-ROM drive
ide0 at 0x1f0-0x1f7,0x3f6 on irq 14
Probing IDE interface ide1...
hdc: HL-DT-STDVD-ROM GDR8163B, ATAPI CD/DVD-ROM drive
ide1 at 0x170-0x177,0x376 on irq 15
Probing IDE interface ide2...
Probing IDE interface ide3...
Probing IDE interface ide4...
Probing IDE interface ide5...
hda: max request size: 128KiB
hda: 160086528 sectors (81964 MB) w/2048KiB Cache, CHS=65535/16/63, UDMA(33)
hda: cache flushes supported
/dev/ide/host0/bus0/target0/lun0: p1 p2 p3 p4 < p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16 >
hdb: ATAPI 40X CD-ROM CD-R/RW drive, 2048kB Cache, UDMA(33)
Uniform CD-ROM driver Revision: 3.20
hdc: ATAPI 52X DVD-ROM drive, 256kB Cache, UDMA(33)
libata version 1.10 loaded.
mice: PS/2 mouse device common for all mice
input: AT Translated Set 2 keyboard on isa0060/serio0
psmouse.c: Failed to reset mouse on isa0060/serio1
input: PS/2 Generic Mouse on isa0060/serio1
psmouse.c: Failed to enable mouse on isa0060/serio1
md: linear personality registered as nr 1
md: raid0 personality registered as nr 2
md: raid1 personality registered as nr 3
md: raid10 personality registered as nr 9
md: raid5 personality registered as nr 4
raid5: measuring checksumming speed
8regs : 1080.000 MB/sec
8regs_prefetch: 1020.000 MB/sec
32regs : 812.000 MB/sec
32regs_prefetch: 764.000 MB/sec
pII_mmx : 2168.000 MB/sec
p5_mmx : 2904.000 MB/sec
raid5: using function: p5_mmx (2904.000 MB/sec)
raid6: int32x1 332 MB/s
raid6: int32x2 410 MB/s
raid6: int32x4 265 MB/s
raid6: int32x8 253 MB/s
raid6: mmxx1 675 MB/s
raid6: mmxx2 1136 MB/s
raid6: sse1x1 644 MB/s
raid6: sse1x2 1058 MB/s
raid6: using algorithm sse1x2 (1058 MB/s)
md: raid6 personality registered as nr 8
md: multipath personality registered as nr 7
md: md driver 0.90.1 MAX_MD_DEVS=256, MD_SB_DISKS=27
device-mapper: 4.4.0-ioctl (2005-01-12) initialised: [email protected]
NET: Registered protocol family 2
IP: routing cache hash table of 2048 buckets, 32Kbytes
TCP established hash table entries: 16384 (order: 6, 262144 bytes)
TCP bind hash table entries: 16384 (order: 5, 196608 bytes)
TCP: Hash tables configured (established 16384 bind 16384)
NET: Registered protocol family 1
NET: Registered protocol family 10
IPv6 over IPv4 tunneling driver
NET: Registered protocol family 17
ACPI wakeup devices:
PCI0 PCI1 UAR1 UAR2 USB0 USB1
ACPI: (supports S0 S1 S4 S5)
devfs_mk_dev: could not append to parent for md/0
md: Autodetecting RAID arrays.
md: autorun ...
md: ... autorun DONE.
ReiserFS: hda5: found reiserfs format "3.6" with standard journal
ReiserFS: hda5: using ordered data mode
ReiserFS: hda5: journal params: device hda5, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max t
rans age 30
ReiserFS: hda5: checking transaction log (hda5)
ReiserFS: hda5: Using r5 hash to sort names
VFS: Mounted root (reiserfs filesystem) readonly.
Mounted devfs on /dev
Freeing unused kernel memory: 288k freed
Adding 96380k swap on /dev/discs/disc0/part3. Priority:-1 extents:1
Adding 96348k swap on /dev/discs/disc0/part10. Priority:-2 extents:1
kjournald starting. Commit interval 5 seconds
EXT3 FS on hda2, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
ReiserFS: hda6: found reiserfs format "3.6" with standard journal
ReiserFS: hda6: using ordered data mode
ReiserFS: hda6: journal params: device hda6, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max t
rans age 30
ReiserFS: hda6: checking transaction log (hda6)
ReiserFS: hda6: Using r5 hash to sort names
ReiserFS: hda7: found reiserfs format "3.6" with standard journal
ReiserFS: hda7: using ordered data mode
ReiserFS: hda7: journal params: device hda7, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max t
rans age 30
ReiserFS: hda7: checking transaction log (hda7)
ReiserFS: hda7: Using r5 hash to sort names
ReiserFS: hda8: found reiserfs format "3.6" with standard journal
ReiserFS: hda8: using ordered data mode
ReiserFS: hda8: journal params: device hda8, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max t
rans age 30
ReiserFS: hda8: checking transaction log (hda8)
ReiserFS: hda8: Using r5 hash to sort names
ReiserFS: hda9: found reiserfs format "3.6" with standard journal
ReiserFS: hda9: using ordered data mode
ReiserFS: hda9: journal params: device hda9, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max t
rans age 30
ReiserFS: hda9: checking transaction log (hda9)
ReiserFS: hda9: Using r5 hash to sort names
Real Time Clock Driver v1.12
8139too Fast Ethernet driver 0.9.27
ACPI: PCI Interrupt Link [LNKB] enabled at IRQ 10
PCI: setting IRQ 10 as level-triggered
ACPI: PCI interrupt 0000:00:0e.0[A] -> GSI 10 (level, low) -> IRQ 10
eth0: RealTek RTL8139 at 0xded90000, 00:50:fc:cd:88:dd, IRQ 10
eth0: Identified 8139 chip type 'RTL-8100B/8139D'
Forcing 10Mbps half-duplex operation.
ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 9
PCI: setting IRQ 9 as level-triggered
ACPI: PCI interrupt 0000:00:07.5[C] -> GSI 9 (level, low) -> IRQ 9
PCI: Setting latency timer of device 0000:00:07.5 to 64
usbcore: registered new driver usbfs
usbcore: registered new driver hub
Initializing USB Mass Storage driver...
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
USB Universal Host Controller Interface driver v2.2
ACPI: PCI Interrupt Link [LNKD] enabled at IRQ 9
ACPI: PCI interrupt 0000:00:07.2[D] -> GSI 9 (level, low) -> IRQ 9
uhci_hcd 0000:00:07.2: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller
uhci_hcd 0000:00:07.2: irq 9, io base 0xd400
uhci_hcd 0000:00:07.2: new USB bus registered, assigned bus number 1
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 2 ports detected
ACPI: PCI interrupt 0000:00:07.3[D] -> GSI 9 (level, low) -> IRQ 9
uhci_hcd 0000:00:07.3: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (#2)
uhci_hcd 0000:00:07.3: irq 9, io base 0xd000
uhci_hcd 0000:00:07.3: new USB bus registered, assigned bus number 2
hub 2-0:1.0: USB hub found
hub 2-0:1.0: 2 ports detected
usb 1-2: new low speed USB device using uhci_hcd and address 2
usbcore: registered new driver hiddev
usb 2-2: new full speed USB device using uhci_hcd and address 2
scsi0 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 2
usb-storage: waiting for device to settle before scanning
input: USB HID v1.10 Mouse [Logitech USB Mouse] on usb-0000:00:07.2-2
usbcore: registered new driver usbhid
drivers/usb/input/hid-core.c: v2.0:USB HID core driver
Disabled Privacy Extensions on device c05d68a0(lo)
Vendor: USB MASS Model: STORAGE DEVICE Rev: 0.10
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sda at scsi0, channel 0, id 0, lun 0
usb-storage: device scan complete
eth0: no IPv6 routers presentThe PC was indeed turned off between the two checks.
However the first check was not performed right before the shutdown, but few hours before it.
:idea:
(...) varying from browser cache data increase to a cronjob like updatedb, or even you installing or downloading something.
When I've read these words I have started to "scroll" back in my memory buffer and eventually I've remembered that the only thing I did as superuser was to download some Firefox extensions which (surprise or not...) summed up to ~12M.
So we have the answer for this one too thanks to your hints
PS: That's exactly the reason why I've made a small / partition - to keep a close eye on it's usage and to ring some allarms when needed.
Again, thank you. -
JComboBox Length question!
When i use JComboBox,it's length is fixed.Perhaps some items is too long to display,so user can't understand it clearly.So i want find JComboBox that can expand automaticly,if item is long,it will be expanded.I tried several function JComboBox provided,but it's remain as usral.I don't know if some master-hand meets same question! Thanks a lot!
If you want the List wider, look [url http://www2.gol.com/users/tame/swing/examples/SwingExamples.html]here
If you want the whole combo wider, use
myCombo.setMinimumSize(new Dimension(200,20));
It's also possible to calculate the width of string in a certain font (to plug in above), but you can search for that. -
I think is a very simple question, I ve got a JComBox with an array of Strings. Something like this:
JPanel myPanel;
JComBox box;
String levels[]={"Level 1","Level 2","Level 3","Level 4","Level 5"};
box = new JComboBox (levels);
myPanel.add(box);
Ok. My question is: How can I let just the level 1 enable at first, or how can I enable or disable just one level of the JCombox, like level 1 and 2 enable but level 3, 4 and 5 disable.
Thanks a lot!! Hope someone helps me!!I don't think this is possible with a JComboBox. I believe it is with a JMenu and JMenuItems.
You could only display valid options by adding/deleting them. Or you could handle it in the listener code. ie if they select an invalid option do nothing. This would require you keeping track of which options are valid elsewhere in the code. -
CPU Usage Question between Premier and Media Encoder
Hey guys,
Here is the question. I just built a new machine with the following specs:
Intel i7 2.66GHz process overclocked to 3.2GHz
12GB Memory
Nvidia 260 Overclocked video card.
When I export a video from Adobe Premier into Media Encoder, all 8 cores peg out at 100% and thus my CPU temp get hot really quick (78 - 80 degrees Celsius)
Now if I take the same original video file and just drag it into Media Encoder, my 8 cores only show about 24-40% usage and the temp only gets to around 55-60 degrees Celsius.
What is causing such a big difference in CPU usage? I'm afraid to use Adobe Premier as it causes the CPUs to max out everytime. I want to edit my videos, but as stuck with just using AME on the original files.I suspect its simply because in the first case Pr and AME are both running. In the later, just ame loading the Pr project. In the forst case two projects are running simultaneously, the one in Pr and a temp copy in AME.
But more troublesome to me is why youve built a system that cant be maxed out. IN editing, we Want the CPUs to peg to process as fast as possible. IMHO; You should re-think the design of your workstation if it overheats so easily.
Curt -
Some questions of Widgets and RAM usage:
a) when you close dashboard/widget RAM usage eventually drops to zero?
b) when you de-activate widgets, do they use any RAM even if you activate Dashboard?
c) anyone have experience with that 'turn widgets on at login' app? RAM usage?
THanks.Hello,
As far as I know and having recently been testing on my own machines, Widgets do seem to play a pretty big role in RAM usage.
Strangely enough, I've noticed it on my G5 the most (probably because I use it more), that when Widgets are off, everything seems qiute a bit more snappy...apps launch MUCH faster, and actions take less time.
I really like Widgets for the most part, but there seem to be memory leaks the longer they're enabled, and the longer the machine is up and running.
Relaunching the dock seems to work SOME of the time...restarting seems to always work.
You can view what's going on in the Activity Monitor, located in your Utilities folder.
You can disable Widgets by this method in the Terminal:
To turn Dashboard off:
defaults write com.apple.dashboard mcx-disabled -boolean YES
To turn Dashboard on:
defaults write com.apple.dashboard mcx-disabled -boolean NO
You have to restart the Dock after making either change for it to take effect:
killall Dock
or Onyx has this ability.
After doing this I would suggest a restart just to make sure.
After doing so, launch Activity Monitor to see your free RAM.
Hope this was helpful.
G5 Dual 2.0 2 GHZ, 2 GB RAM, G4 Dual 450, iBook Graphite SE Mac OS X (10.4.5) -
Retrieving values from a JComboBox - Design question.
I would like some design guidance on a problem that I am hoping has been solved before. Here is my situation:
I have a JComboBox that I populate with String values from a database table. The exact set of values to be loaded into the JComboBox varies according values specified elsewhere on the GUI.
When I select an item from the JComboBox, I need to read the database to retrieve more information. The text is not sufficient for me to identify the data I need, so I need to get the table key from somewhere.
Is there anyway I can associate my table key with the text value inside the JComboBox and retrieve it when the user selects a drop down value from the JComboBox?
Many thanks in advance.when you load the data from the db, try to get ALL the information needed: item label+item value+description. put this data into a map (a hashmap) for example using a unique identifier. For example, use a numeric index. In this case, the item value should be the index that uniquely identifies your items.
create a simple bean that encapsulates the item contents: index+value+label, description.
Doing this will avoid the huge db access occurences.
hth -
Final Cut Server Usage Question...
I have just started researching this product and confused a little about it. I am the IT dept at a small advertising agency that does quite bit of video work.
Mostly all of the workstation in the office are PowerMac G5's that clock in at dual 2.2GHz or above with 4GB of RAM
We also have an Xserve G5 (Dual) with 4GB of RAM a 2GB fibre card installed and an apple RAID system as well. The office is all wired with 10/100.
With final cut server - will they be able to actullay edit video over the network on the RAID through the Xserve. Is that what this software is for? Sorry for such a lame question. If not is this basically like Adobe's Bridge application?
Let me know.Yes it does do basically what your saying, You can leave the source media on the server and just edit from your local machine. You can also download proxies (lower res version of the source media) and edit on a laptop or with a PC without having to move the large source files.
I cant imagine any reason why any company or small business using more than one editing machine wouldn't go for this solution
Does that answer your question? -
Sleep usage question - not problem
Sleep seems to work differntly on my new iMac compared to my old G4 FP iMac.
Question - are these observations below normal?
1. When I used to put my G4 to sleep (by clicking apple/sleep), my G4 would seem to more completely sleep. Even my external Lacie firewire drive wuold turn off its light and shut down. But with my intel iMac, the light on the external drive does not turn off.
2. It seems like the iMac fan is still running after putting it to sleep. When I check the next morning the iMac still seems warm/hot with the fan still running(though amost silently).
3. Also I notice that my G4 would provide the stobing light only when the computer was put to sleep, if the monitor alone was sleeping the strobing light would not flash, but with the intel iMac the strobing light will flash if the monitor has timed to sleep, but the computer has not.
4. I'd also note that I have the preference set to allow hard drive to sleep. And I do find that I can hear the hard drive starting up again (especially the firewire drive) after not using the drive for a while. Nevertheless, the firewire drive light is on all the time.
Thanks for any comments,
Tony554/3000
Hi Tony,
Yes, it seems the light (steady or pulsing) "tasks" have changed since the G4 iMacs.
See here:
- http://docs.info.apple.com/article.html?artnum=58016
So it may very well be different again with the new Core Duo iMacs?
Of course your computer is awake and works, if it's only the display sleeping.
Axl -
I am trying to use a custom renderer for a jcombobox in order to show combobox items in different font color. I get a DefaultListCellRenderer and update it according to my needs (setting font color). When I run the application, the combobox is populated properly. When I select one of the items (say "Red") from the combobox, the item gets selected, but the after the selection the font color of the item that is selected defaults to black (instead of red here). What should I do so that after selecting the item, the selected item is shown in the appropriated font color as indicated by custom renderer.
Here is the code for the custom renderer.
private class ColorCmbRenderer implements ListCellRenderer {
protected DefaultListCellRenderer defaultRenderer = new DefaultListCellRenderer();
private final Dimension preferredSize = new Dimension(50, 23);
public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected,
boolean cellHasFocus) {
JLabel renderer = (JLabel) defaultRenderer.getListCellRendererComponent(list, value, index,
isSelected, cellHasFocus);
switch (index) {
case 0: renderer.setText("Black");
renderer.setForeground(Color.BLACK);
break;
case 1: renderer.setText("Red");
renderer.setForeground(Color.RED);
break;
case 2: renderer.setText("Blue");
renderer.setForeground(Color.BLUE);
break;
case 3: renderer.setText("Green");
renderer.setForeground(Color.GREEN);
break;
default: break;
renderer.setPreferredSize(preferredSize);
return renderer;
}Another thing that I wanted to know is whether each of the items in the jcombobox can be associated with individual Action objects by using something like setAction(new HTMLEditorKit.BoldAction()).
regards,
Nirvan.There are 3 foregrounds to be set.import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import javax.swing.*;
import javax.swing.plaf.basic.BasicComboBoxRenderer;
public class ComboColors {
JComboBox comboBox;
public static void main(String[] args) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
new ComboColors().makeUI();
public void makeUI() {
comboBox = new JComboBox(
new Object[]{"BLACK", "RED", "BLUE", "GREEN"});
comboBox.setRenderer(new BasicComboBoxRenderer() {
private final Color[] colors = {
Color.BLACK, Color.RED, Color.BLUE, Color.GREEN
@Override
public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, value,
index, isSelected, cellHasFocus);
if (index == -1) {
index = comboBox.getSelectedIndex();
setForeground(colors[index]);
list.setSelectionForeground(colors[index]);
comboBox.setForeground(colors[index]);
return this;
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.add(comboBox);
frame.add(new JButton("Dummy"), BorderLayout.SOUTH);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}db -
Hi,
I was wondering what kind of listener I would use to detect enter being pressed in a JComboBox.
I tried an actionListener but this sends actionEvents at far too many times, I want to limit what I'm doing to only when the user presses enter in the JComboBox.
It seems rather odd that a keyListener can't be used with a JComboBox, or at least according to the API specifications...
All help is very appreciated!!The JComboBox itself just has the text field and then the down arrow, correct? Like if I am writing in that text field I am writing in the JComboBox? Basically all i need is a way to do something when the user presses 'enter', but not when all the other various things that trigger ordinary action events are fired. Using a keyListener to find out whether the key pressed was 'enter' seemed like the best way to do this, but if key events aren't even getting sent when the focus is in the text portion of the JComboBox that may not be the case. If there's anyway i can explain the problem better I'd be happy to do so.
Thanks -
I cant seem to find out how to add items to my jcombobox using Forte.
I have this :
String[] dbId = { "579", "459", "789", "098", "297" };
jComboBox1.addItem(dbId);
Where do I put this code to fill the combo box with the String array?
SteveDepends on what application you are building.
If you are building a standalone application, put those codes in the constructor of your application class.
If you are building an applet, put those codes in the init() method of your applet. -
When using a JComboBox the selected item is indicated in the dropdown list with a checkmark. I created a really simple renderer that changes the color of the text based on an attribute of the Object:
public class SupportedObjectComboBoxRenderer extends JLabel implements ListCellRenderer {
public SupportedObjectComboBoxRenderer() {
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
SupportedObject so = (SupportedObject)value;
this.setForeground(so.isActive() ? Color.BLACK : Color.GRAY);
this.setText(so.getName());
return this;
}The checkmark is no longer displayed. I believe I need to render that myself (in the JLabel). Is that default checkmark icon accessible so that I can load it as a resource? Or is there something else I should be doing to show it?Is there a way you can change the text color of a JComboBox item without
otherwise disrupting the look and feel?don't know if this will work for you, but worth a try
import java.awt.*;
import javax.swing.*;
class Testing extends JFrame
JComboBox cbo = new JComboBox(new String[]{"London","Madrid","New York","Rome","Sydney","Washington"});
public Testing()
setSize(150,75);
setLocation(400,300);
setDefaultCloseOperation(EXIT_ON_CLOSE);
cbo.setRenderer(new MyRenderer());
JPanel jp = new JPanel();
jp.add(cbo);
getContentPane().add(jp);
public static void main(String args[]){new Testing().setVisible(true);}
class MyRenderer extends DefaultListCellRenderer
public Component getListCellRendererComponent(JList list,Object value,
int index,boolean isSelected,boolean cellHasFocus)
JLabel lbl = (JLabel)super.getListCellRendererComponent(list,value,index,isSelected,cellHasFocus);
lbl.setForeground(index%2==0? Color.RED:Color.BLUE);
return lbl;
} -
The usage question of inputComboboxListOfValues
1.Can I disable the popup search on inputComboboxListOfValues ?
2.I set the items attribute according to Tag reference,but it seems not work.
I add items="#{backingBeanScope.backing_LOVSuggestion.allItems}" the List contains javax.faces.model.SelectItem ,But Jdev said the items attribute is deprecated,so that means I can't use it,I must implement the inputOfValuesModel? I study the adf demo, it seems a little complex,I only need a suggestion hints and construct the list from managed bean,and not need the popup search.
3.each time I click the combox down arrow,I find the backing bean construction method is called, I bind the combox to the backing bean's attribute. I think the construction method will only be called once during the page construction,but it not.What the lifecycle is it ? or my configuration is wrong ?ey finally I've succeded into lauching something from
a telnet session. Now my question is, how to make it
run permanently, even if I leave my telnet session ?Assuming the server is UNIX, "nohup java Foo &" will do the job.
"nohup" tells the system not to shut it down when you exit.
The "&" tells the system to put the program into the background.
Bhav -
The new Yosemite Photos app local storage usage question
Hi,
Did anyone check the local storage usage for the new Photos on Yosemite?
How much space does it take for all the lores photos locally if the originals are stored in iCloud.
Lets say if 100GB of RAW files are migrated from Aperture in to Photos to cloud. This should be 100GB in the cloud and how much on OS X?
Can a RAW file still be downloaded from cloud later or are they transformed to jpgs once uploaded?
What if there is not enough storage for all lores photos on iOS or OS X representing all the original iCloud photos?
I'm really puzzled about this.
ThanksI just installed the Yosemite upgrade with Photos. I don't use Aperture of the iCloud, but the iPhotos library migrated with about the same disk space, but it is doubled, because the old iPhoto library is still on disk.
Maybe you are looking for
-
Looking for an internal traffic monitor for a RV042
I have an RV042 router and I'm looking to monitor the total upstream and downstream traffic from within the router. I know there is tons of software that I can put on a network computer to monitor traffic, but is there any software that I can put on
-
OIM91 Weblogic Install: Cannot Install because already installed
I am attempting to install OIM 9.1 with Java 142_15 for Weblogic 8.1 SP6 server. When I get to the server input information, after I press next, it gives the following error: "Oracle identity Manager Installer has found that Oracle Identity Manager i
-
Dahdi.service script error after reboot
Hi! Setup DAHDI drivers. Created a service-file as follows: [Unit] Description = DAHDI configuration script. After = network.target [Service] Type = forking WorkingDirectory = / home ExecStart = / usr / bin / dahdi_cfg-vvvv ExecStop = / usr / bin / d
-
I accidently clicked remember password - how do i undo this?
it was for my email account - please help...!
-
Installing Facebook displays my Dad's photo in iMessage.
When installing Facebook on my iPad (rather than just logging in via the app) it suddenly displays my Dad's photo as mine in iMessage. I bought him his first iPod and I registered my iPad to his account when we first bought Apple products. He just bo