Menu

How do u select an item from a Combobox

Help
Anonymous
2002-02-14
2002-02-16
  • Anonymous

    Anonymous - 2002-02-14

    Hi!
    I am very new to using JFCUnit.
    I am able to do some simple thing, but I cant seem to find a way of click some item from a  comboBox.
    I have a JOptionPane, which allows the user to select from a list of dropdowns.
    I have tried
    JComboBox list = (JComboBox)helper.findNamedComponent(javax.swing.JComboBox.class, dlg, 0);
            helper.enterClickAndLeave(this, list);
            awtSleep();
           
           
            JComponent obj = (JComponent)list.getItemAt (0);
          
            helper.enterClickAndLeave(this, obj);

    where dlg, is the list of showing dialogs, which is a JOptionPane.
    it throws an exception , any idea how to select a value form a Combo box.

    Or is there some place where I can download some documentation on JFCUnit.
    Any help will be greatly appreciated.

     
    • Vijay Aravamudhan

      If its a modal dialog, then JFCUnit cannot be used since the dialog blocks all events till an input is given directly. If not, then you can look at the examples.
      Vijay

       

Log in to post a comment.