Community Forums
Page 2 of 8 FirstFirst 1234 ... LastLast
Results 6 to 10 of 39

Thread: How to disable the Cancel button

  1. #6
    Join Date
    Jul 2007
    Location
    Luxembourg
    Posts
    143
    I don't have example code for this, but I can provide you the idea how to do it:
    a) Write an extension to CustomCodePanel and register your own listener to the next button
    Code:
    Container guiContainer = ((GUIAccess) ccpp.getService(GUIAccess.class)).getFrame();
    if (guiContainer instanceof JFrame) {
    	guiContainer = (Container) ((JFrame) guiContainer).getContentPane().getComponent(0);
    	JButton guiJButton = (JButton) ((Container) guiContainer.getComponent(3)).getComponent(2);
    	guiJButton.addActionListener(new NextListener(guiContainer));
    }
    b) In the listener, wait for the button text to be "Install" and afterwards disable the Cancel button.

    I hope this helps.

    Best Regards,
    Yves

  2. #7
    Join Date
    Nov 2007
    Posts
    5
    Thanks for your help.
    I wrote some test code based on your idea but it seems like this doesn't work. I got the code to execute every time the next button was pressed. When the text was Install I disabled the Cancel button. But it seems like InstallAnywhere enables the button once the installation starts again.

    I also tried to put the Custom code Panel as the last step in Pre-installation. Then I didn't need to add the listener to any button. Even in this case the Cancel button seem to get enabled.

    I have given up for now. Instead I hope that this will be fixed sometime in the future. In that case we may be able to our next release instead.

  3. #8
    Join Date
    Jul 2007
    Location
    Luxembourg
    Posts
    143
    Try to put the Custom Code Panel as first step in the Install section...

    Best Regards,
    Yves

  4. #9
    Join Date
    Nov 2007
    Posts
    5
    I tried to put a Custom Code Action in the install section but this didn't work. I am not sure how I put a custom code panel in the install section?

    Best regards
    Henric
    Last edited by henric; 11-09-2007 at 03:06 AM.

  5. #10
    Join Date
    Jul 2007
    Location
    Luxembourg
    Posts
    143
    I will try to disable it today and let you know if I was successful...

    Best Regards,
    Yves

Page 2 of 8 FirstFirst 1234 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •