Results 1 to 2 of 2
- 06-28-2012, 02:05 PM #1
Member
- Join Date
- May 2012
- Posts
- 6
- Rep Power
- 0
Add if else statement for jcombobox?
Hi guys, I'm new to java and I have come to a dead end got no idea how to add a if and else statement to combobox.. help?
private static String[] times = {"Total Time","1 Hour", "45 Minutes", "30 Minutes", "15 Minutes", "7.30 Minutes", "6 Minutes", "3 Minutes"};
JComboBox times1 = new JComboBox(times);
How do add if 1 hour is selected, 45 minutes is selected and so on.. please help thanks..
-
Re: Add if else statement for jcombobox?
You don't add it to the JComboBox, you would add it to some listener, perhaps an ActionListener that's listening to the JComboBox or to a JButton. Please do yourself a favor and read the JComboBox tutorial to see how this is done. You won't regret doing this.
Similar Threads
-
the switch statement and unreachable statement error
By name in forum New To JavaReplies: 2Last Post: 03-26-2012, 04:27 PM -
Need help for a jcombobox
By Alexis in forum AWT / SwingReplies: 4Last Post: 09-16-2011, 02:13 AM -
Activate JComboBox 1 when object is selected in JComboBox 2...
By bahumbaba in forum AWT / SwingReplies: 2Last Post: 12-10-2009, 01:58 PM -
JComboBox
By Fosters in forum AWT / SwingReplies: 0Last Post: 08-10-2008, 01:22 PM -
Statement or Prepared Statement ?
By paty in forum JDBCReplies: 3Last Post: 08-01-2007, 04:45 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks