Results 1 to 2 of 2
Thread: Get the item in JComboBox
- 01-24-2011, 05:56 AM #1
Member
- Join Date
- Dec 2010
- Posts
- 4
- Rep Power
- 0
- 01-24-2011, 09:48 AM #2
Member
- Join Date
- Dec 2010
- Posts
- 4
- Rep Power
- 0
I already solved the issue.
I created a String powerState to save the value of newItem (value from combo box).
Then i just access the static field normally using Gui.powerState .
Java Code:private void jcb_powerOffActionPerformed(java.awt.event.ActionEvent evt) { JComboBox cb = (JComboBox)evt.getSource(); String newItem = cb.getSelectedItem().toString(); powerState=newItem; }
Similar Threads
-
Getting an item from an array
By ile4 in forum New To JavaReplies: 9Last Post: 01-13-2011, 03:42 PM -
Selecting last item from a Jcombobox wont work
By cotarelo in forum AWT / SwingReplies: 1Last Post: 07-13-2010, 11:30 PM -
Activate JComboBox 1 when object is selected in JComboBox 2...
By bahumbaba in forum AWT / SwingReplies: 2Last Post: 12-10-2009, 01:58 PM -
Creating multiline item in JComboBox
By javabud in forum AWT / SwingReplies: 2Last Post: 07-17-2009, 03:50 PM -
[SOLVED] Item too big for JComboBox
By nwboy74 in forum AWT / SwingReplies: 5Last Post: 02-23-2009, 08:21 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks