Search:

Type: Posts; User: Norm

Search: Search took 0.10 seconds.

  1. Re: JComboBox issue. If user selects any item do this... (if statment)

    I think you will have to use one of the class's methods. You can experiment the same as I would have to experiment to find it. You will learn something by doing the experiments that will help you in...
  2. Re: JComboBox issue. If user selects any item do this... (if statment)

    Do you have the API doc? Read it looking for any methods that will do what you want. Try all that look useful with lots of different combinations of arguments and see if any of them do what you want.
  3. Re: JComboBox issue. If user selects any item do this... (if statment)

    I'd use one of the JComboBox methods.
  4. Re: JComboBox issue. If user selects any item do this... (if statment)

    Have you tried any of the JComboBox class's methods to change what is shown?
  5. Re: JComboBox issue. If user selects any item do this... (if statment)

    Can you show an example by making a list and adding comments to describe the problem:
    first item << can see this one
    second item
    third item
  6. Re: JComboBox issue. If user selects any item do this... (if statment)

    What happens when you execute the insertItemAt("",0) method?
    Where is the empty String added?
  7. Re: JComboBox issue. If user selects any item do this... (if statment)

    When you wanted to insert the empty String into the list.
  8. Re: JComboBox issue. If user selects any item do this... (if statment)

    Please make a small, simple program that compiles, executes and shows the problem.
  9. Re: JComboBox issue. If user selects any item do this... (if statment)

    What variable has the null value?
  10. Re: JComboBox issue. If user selects any item do this... (if statment)

    What is the purpose of that code? It is useless for testing.
    The message seems unrelated to anything that the user has selected.
  11. Re: JComboBox issue. If user selects any item do this... (if statment)

    For testing the program must compile and execute. The code you posted will not compile.

    The purpose of the test program is to find a way to detect if the user has made a selection in the...
  12. Re: JComboBox issue. If user selects any item do this... (if statment)

    Do you have any listeners for the JComboBox? When are they called?
    Is there a listener for when a user selects an item?
    If that listener is not called, does that mean that the user has not...
  13. Re: JComboBox issue. If user selects any item do this... (if statment)

    Determine if THE USER has selected anything by using a listener that sets a flag if the user has selected anything.
    When the button is pressed, test if the flag is set. If the flag is not set, the...
  14. Re: JComboBox issue. If user selects any item do this... (if statment)

    I thought your problem was detecting when nothing had been selected in the JComboBox before the button was pressed.
  15. Re: JComboBox issue. If user selects any item do this... (if statment)

    Write test code that prints out the values returned by the JComboBox methods to see what they are.
    Try using one/some of the JComboBox methods to set a condition that could be tested for.
    Have a...
  16. Re: JComboBox issue. If user selects any item do this... (if statment)

    What do the methods of the JComboBox return when nothing has been selected?
    Can your code remember if a selection has been made or not?
  17. Re: JComboBox issue. If user selects any item do this... (if statment)

    Can the program know if an item was selected? Suppose it could determine that?
    If you know that, can you decide what the program should do when the user press the button?


    Is this what is...
  18. Re: JComboBox issue. If user selects any item do this... (if statment)

    Please explain the problem with using the methods of the JComboBox class to determine what the user has done or not done.
  19. Re: JComboBox issue. If user selects any item do this... (if statment)

    You can add a listener to the JComboBox class that will be called when the user selects an item.
    It also has methods about what has been selected.

    Read the API doc for the methods.
  20. Re: JComboBox issue. If user selects any item do this... (if statment)

    Can you explain what variables have what values that you could test for the "condition"?
    Like x > 10 or String not equal to "ASD"
Results 1 to 20 of 20