How do you select a string in a list using its index count??

Add list box to form and add entries("strings")

try this

Public Class Form1

    Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
        Select Case ListBox1.SelectedIndex
            Case 1
                MsgBox(ListBox1.SelectedItem)
            Case 2
                MsgBox(ListBox1.SelectedItem)



        End Select

    End Sub
End Class

oops i used .net

Add list box to form and add entries("strings")

try this

Public Class Form1

    Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged
        Select Case ListBox1.SelectedIndex
            Case 1
                MsgBox(ListBox1.SelectedItem)
            Case 2
                MsgBox(ListBox1.SelectedItem)



        End Select

    End Sub
End Class

oops i used .net

but i think u can use it in java as well..i am not sure

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.