|
-
Nov 4th, 2003, 12:19 PM
#1
Thread Starter
New Member
Difficulty grabbing info from a JList.
Hi everyone, this is my first post here!
I have a JListBox which is getting its contents from an Array (containing names of months.)
I need to produce an IF statement to determine how many days there are in a month, for example, I need to say something like :
If (contents of selected field in JListBox = "February")
Do this
However, I'm new to Java and any attempt I have made has mucked up.
I thought something like :
String CurrentMonth = JListBox.getSelectedValue();
if CurrentMonth = "February"
Do this (something to only produce 28 boxes etc)
Would work, but it doesnt for some reason. The error is "Incompatible types."
Could someone point me in the right direction?
Also is there an easier way of determining how many days there are in a month within Java?
Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|