Search:

Type: Posts; User: hooshdar3

Search: Search took 0.09 seconds.

  1. Replies
    28
    Views
    3,043

    Re: How to set a button event trigger?

    But what if I have more buttons?
    I have 1 HButton, named 'button' on a 'JDialog' named 'dialog', and anotther JButton named 'queryButton' on a 'JDialog' named 'queryDialog'.
    I changed the...
  2. Replies
    28
    Views
    3,043

    Re: How to set a button event trigger?

    OK, but I have asked my question already
  3. Replies
    28
    Views
    3,043

    Re: ActionEvent

    Heh!unbelievable!I haven't done that!

    OK, I added that line, and now get the compile error:
  4. Replies
    28
    Views
    3,043

    ActionEvent

    Hi.
    I set an action listener for my button but nothing happens when the button is clicked.Why?
    Here is my code:

    public class sysinfoHooshi implements ActionListener{
    static JTextField tf =...
  5. Replies
    28
    Views
    3,043

    Re: How to set a button event trigger?

    Why is it that your ActionListener is not followed by a pair of parentheses, and are followed by a pair of braces instead?
  6. Replies
    28
    Views
    3,043

    Re: How to set a button event trigger?

    What do you mean?
    I declare them as e.g:
    public static final JTextField tf = new JTextField("") outside any function? then what happens when the user chabges their content? Will
    tf.getText()...
  7. Replies
    28
    Views
    3,043

    Re: How to set a button event trigger?

    The end-user is supposed to enter numbers in the text-fields. Doesn't Final make them unchangable? What about private?
  8. Replies
    28
    Views
    3,043

    Re: How to set a button event trigger?

    I asked because then the TextFields will not be known in the function actionPerformed()
  9. Replies
    28
    Views
    3,043

    Re: How to set a button event trigger?

    Do I have to put the code inside a function?

    N.B:Should the second line be:
    btn.addActionListener( new ActionListener() )?
  10. Replies
    28
    Views
    3,043

    Re: How to set a button event trigger?

    It is the topic of this topic
  11. Replies
    28
    Views
    3,043

    Re: How to set a button event trigger?

    No.I meant I want the last two lines onward be executed then. there is processing code not shown here.
    Again, the last two lines are:

    int simTime = Integer.parseInt( tf.getText() );;
    int...
  12. Replies
    28
    Views
    3,043

    Re: How to set a button event trigger?

    Before the last two lines.

    --- Update ---



    But this way, there is no way to distinguish between different events for one component, isn't it?
  13. Replies
    28
    Views
    3,043

    How to set a button event trigger?

    Hi.
    I have created a modal dialog box thus:


    JDialog dialog = new JDialog();
    dialog.setModal(true);
    dialog.setSize(400, 150);

    dialog.setTitle("Input dialog");
Results 1 to 13 of 13