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

[Linux] TableView setMouseTransparent method does not make mouse transparent

    Details

      Description

      ADDITIONAL SYSTEM INFORMATION :
      Java 11 and JavaFX built from source. JavaFX is integrated with the JDK. This bug can be reproduced with the standalone SDK, however.

      A DESCRIPTION OF THE PROBLEM :
      Setting Tableview's setMouseTransparent method does not make the window transparent in the current version of JavaFX.

      REGRESSION : Last worked in version 10

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Using JavaFX 11, Create any TableView and set setMouseTransparent to true.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Mouse transparency(mouse ignores the window and instead acts as if the window doesn't exist).
      ACTUAL -
      No mouse transparency.

      ---------- BEGIN SOURCE ----------
      Unable to provide due to Netbeans being unable to locate main class in a modular project(for some reason) and refusing to compile in a non modular environment because of JavaFX Deployment not being included in the JDK. However, here is the code that I am using:

      public class OSDStage extends Stage
      {
          public static boolean OSD_ENABLED = false;
          
          
          private final Scene scene;
          
          public OSDStage()
          {
              super();
              super.setTitle("Goliath Overclocking Utility OSD");
              super.setResizable(false);
              super.setX(0);
              super.setY(0);
              super.initStyle(StageStyle.TRANSPARENT);
              super.setAlwaysOnTop(true);
              
              scene = new Scene(new OsdTable());
              scene.setFill(Color.TRANSPARENT);
              
              
              OSD_ENABLED = true;
              
              super.setScene(scene);
              super.show();
          }
          
          @Override
          public void close()
          {
              OSD_ENABLED = false;
              super.close();
          }
          
          private class OsdTable extends TableView<NvAttribute>
          {
              private final TableColumn<NvAttribute, String> colOne, colTwo;
              
              public OsdTable()
              {
                  super();
                  super.setPrefWidth(352);
                  super.setColumnResizePolicy(TableView.UNCONSTRAINED_RESIZE_POLICY);
                  super.setEditable(false);
                  super.setMouseTransparent(true);
                  super.setTableMenuButtonVisible(false);
                  super.getStylesheets().add("goliathoufx/css/osd.css");
                  super.setItems(FXCollections.observableArrayList(InstanceProvider.getOSDAttributes()));
                  
                  colOne = new TableColumn<>();
                  colOne.setMinWidth(200);
                  colOne.setMaxWidth(200);
                  colOne.setStyle("-fx-text-fill: #00FF00;");
                  colOne.setCellValueFactory(new PropertyValueFactory<>("displayName"));
              
                  colTwo = new TableColumn<>();
                  colTwo.setMinWidth(150);
                  colTwo.setMaxWidth(150);
                  colTwo.setStyle("-fx-text-fill: #00FF00;");
                  colTwo.setCellValueFactory(new PropertyValueFactory<>("displayValue"));
                  
                  super.getColumns().add(colOne);
                  super.getColumns().add(colTwo);
              }
          }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Use Oracle JDK 9 or 10.

      FREQUENCY : always


        Attachments

        1. osd.css
          0.6 kB
        2. OSDMain.java
          0.4 kB
        3. OSDStage.java
          5 kB

          Activity

            People

            • Assignee:
              pbansal Pankaj Bansal
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: