Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8087369

JavaFX 8 OSX WebView CSS opacity not working for Bootstrap button in disabled state

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • 9
    • 8u40
    • javafx
    • Mac OS X 10.10 Yosemite

    • web

      When using WebView to display buttons with Bootstrap CSS the button disappears when the button is in a disabled state. When the button enters the enabled state the button displays correctly.

      The problem is due to the opacity CSS Setting for the Bootstrap ".btn.disabled" class which contains

      opacity: .65;

      If I have the following style on the button as per the bootstrap css, the button does not display

      <input type="button" value="TEST" style="opacity: .65">

      The opacity style works correctly on the same version of JavaFX (8u40) on Windows.


      Here is a code sample which will display the official Bootstrap page at the Buttons - "Disabled State" section

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.layout.*;
      import javafx.scene.web.WebEngine;
      import javafx.scene.web.WebView;
      import javafx.stage.*;



      public class JavaFXWeb extends Application {

      @Override
      public void start(Stage stage) throws Exception {

      BorderPane bp = new BorderPane();

      WebView webView = new WebView();
      WebEngine webEngine = webView.getEngine();
      webEngine.load("http://getbootstrap.com/css/#buttons-disabled");

      bp.setCenter(webView);
      Scene scene = new Scene(bp, 1200, 800);
      stage.setScene(scene);
      stage.setTitle("Disabled Button - Opacity Test");
      stage.show();
      }


      public static void main(String[] args) {
      launch(JavaFXWeb.class, args);
      }
      }

            ant Anton Tarasov (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: