Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Application Programming › Java: Getting my combobox to give me an integer? [UPDATED]
New Posts  All Forums:Forum Nav:

Java: Getting my combobox to give me an integer? [UPDATED] - Page 2

post #11 of 12
Quote:
Originally Posted by kidshenlong;12692446 
That worked perfectly! Kinda feel like I'm cheating though lol any idea why it does this?? And Shadow I'm using edit plus 3

It isn't cheating as much as it is cutting a small corner. It's just because you're adding data points into an Index. The first point always begins at zero-- so if you have it set up like this, you'll pretty much have to add the "+ 1."


Alternatively, you could probably do something like:
Code:
priority.addItem("0");
                priority.addItem("1");
priority.addItem("2");
priority.addItem("3");
priority.addItem("4");
priority.addItem("5");

which I imagine would produce the same result, only now you have 6 data points instead of 5.
Intellect v2
(9 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7-6700K Processor ASUS ROG MAXIMUS VIII HERO LGA1151 DDR4 M.2 SAT... EVGA GTX 1080 SC ACX 3.0 Crucial Ballistix Sport 32GB DDR4 2400 MT/s (PC... 
CoolingKeyboardPowerCase
Noctua NH-D15 Das Keyboard 4 Professional (Brown) Corsair AX860 Fractal Design Define R5 
Mouse
MIONIX NAOS 7000 
  hide details  
Reply
Intellect v2
(9 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core i7-6700K Processor ASUS ROG MAXIMUS VIII HERO LGA1151 DDR4 M.2 SAT... EVGA GTX 1080 SC ACX 3.0 Crucial Ballistix Sport 32GB DDR4 2400 MT/s (PC... 
CoolingKeyboardPowerCase
Noctua NH-D15 Das Keyboard 4 Professional (Brown) Corsair AX860 Fractal Design Define R5 
Mouse
MIONIX NAOS 7000 
  hide details  
Reply
post #12 of 12
Thread Starter 
Ahhhhh I see hmmm. Thanks for that anyway! Rep+
Dark Star
(13 items)
 
  
CPUMotherboardGraphicsRAM
Q6600 - Currently Overclocking ;) Gigabyte GA-EP45-UD3P HD 6950 OCZ Blade LC DDR2 PC29200 4GB (GOT) 
Hard DriveOSMonitorKeyboard
640GB for Storage and OCZ Vertex 2e 60GB Windows 7 Ultimate-Signature Edition 3 x 22" -BenQ G2222HDL Logitech G15 
PowerCaseMouse
Corsair TX850 HAF 932 Logitech G500 
  hide details  
Reply
Dark Star
(13 items)
 
  
CPUMotherboardGraphicsRAM
Q6600 - Currently Overclocking ;) Gigabyte GA-EP45-UD3P HD 6950 OCZ Blade LC DDR2 PC29200 4GB (GOT) 
Hard DriveOSMonitorKeyboard
640GB for Storage and OCZ Vertex 2e 60GB Windows 7 Ultimate-Signature Edition 3 x 22" -BenQ G2222HDL Logitech G15 
PowerCaseMouse
Corsair TX850 HAF 932 Logitech G500 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Application Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Application Programming › Java: Getting my combobox to give me an integer? [UPDATED]