<div dir="ltr">I have investigated the root cause of the issue “<b>JDK-8089009 : TableView with CONSTRAINED_RESIZE_POLICY incorrectly displays a horizontal scroll bar</b>” and have a fix for it.<div class="gmail_quote"><div link="#0563C1" vlink="#954F72" lang="EN-AU"><div class="m_-7341322677666418378WordSection1">
<p class="MsoNormal">Before I get to the actual solution, let me briefly explain the issue and root cause.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><b>Issue:</b></p>
<p class="MsoNormal">When the TableView is set with built-in CONSTRAINED_RESIZE_POLICY, the horizontal scroll bar keeps flickering when the tableView width is reduced.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><b>Cause:</b></p>
<p class="MsoNormal">The table columns widths are recalculated only if the difference of the tableView width and the total columns width is greater than 1px. Because of these improper calculations, if the tableView width is reduced by 1px, the column widths
 are not updated. Which results in computing for hBar visibility in VirtualFlow to improper results and letting the hBar visible. Whereas if the tableView width is reduced by more than 1px, the calculations are done correctly and the hBar visibility is turned
 off. Because of this behaviour, it looks like the hBar is flickering when the tableView width is reduced (let’s say by dragging).</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">To confirm this behaviour, please find the below example that showcases the issue:</p>
<p class="MsoNormal">When the tableView width is reduced/increased by 1px, the column widths are recalculated only after every alternate 1px change. Whereas if the tableView width is reduced/increased by more than 1px, the column widths are calculated correctly.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal" style="background:white"><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">import
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">javafx.application.Application</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">;<br>
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">import
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">javafx.beans.property.SimpleStringProperty</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">;<br>
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">import
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">javafx.beans.property.StringProperty</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">;<br>
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">import
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">javafx.collections.FXCollections</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">;<br>
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">import
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">javafx.collections.ObservableList</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">;<br>
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">import
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">javafx.geometry.Insets</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">;<br>
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">import
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">javafx.scene.Group</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">;<br>
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">import
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">javafx.scene.Scene</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">;<br>
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">import
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">javafx.scene.control.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">*;<br>
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">import
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">javafx.scene.layout.HBox</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">;<br>
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">import
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">javafx.scene.layout.VBox</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">;<br>
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">import
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">javafx.stage.Stage</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">;<br>
<br>
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">public class
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">ConstrainedResizePolicyIssueDemo
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">extends
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">Application
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">{<br>
    </span><span style="font-size:10.0pt;font-family:"Courier New";color:#9e880d">@Override<br>
    </span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">public void
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#00627a">start</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">(</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">Stage
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">primaryStage)
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">throws
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">Exception
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">{<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">TableColumn</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808"><</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">Person</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">,
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">String</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">>
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">fnCol
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">=
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">new
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">TableColumn<>(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#067d17">"First Name"</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">);<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">fnCol</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.setMinWidth(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#1750eb">100</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">);<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">fnCol</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.setCellValueFactory(param -> param.getValue().firstNameProperty());<br>
<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">TableColumn</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808"><</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">Person</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">,
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">String</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">>
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">priceCol
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">=
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">new
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">TableColumn<>(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#067d17">"Price"</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">);<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">priceCol</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.setMinWidth(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#1750eb">100</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">);<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">priceCol</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.setMaxWidth(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#1750eb">150</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">);<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">priceCol</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.setCellValueFactory(param -> param.getValue().priceProperty());<br>
<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">TableColumn</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808"><</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">Person</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">,
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">String</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">>
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">totalCol
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">=
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">new
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">TableColumn<>(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#067d17">"Total"</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">);<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">totalCol</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.setMinWidth(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#1750eb">100</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">);<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">totalCol</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.setMaxWidth(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#1750eb">150</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">);<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">totalCol</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.setCellValueFactory(param -> param.getValue().totalProperty());<br>
<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">ObservableList</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808"><</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">Person</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">>
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">persons
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">=
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">FXCollections</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.<i>observableArrayList</i>();<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">persons</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.add(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">new
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">Person(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#067d17">"Harry"</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">,
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#067d17">"200.00"</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">,
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#067d17">"210.00"</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">));<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">persons</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.add(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">new
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">Person(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#067d17">"Jacob"</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">,
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#067d17">"260.00"</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">,
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#067d17">"260.00"</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">));<br>
<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">TableView</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808"><</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">Person</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">>
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">tableView
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">=
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">new
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">TableView<>();<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">tableView</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.getColumns().addAll(</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">fnCol</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">,
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">priceCol</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">,
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">totalCol</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">);<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">tableView</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.setItems(</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">persons</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">);<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">tableView</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.setColumnResizePolicy(</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">TableView</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.</span><i><span style="font-size:10.0pt;font-family:"Courier New";color:#871094">CONSTRAINED_RESIZE_POLICY</span></i><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">);<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">tableView</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.setMinWidth(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#1750eb">500</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">);<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">tableView</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.maxWidthProperty().bind(</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">tableView</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.minWidthProperty());<br>
<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">Button button1
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">=
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">new
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">Button(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#067d17">"Reduce 1px"</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">);<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">button1</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.setOnAction(e ->
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#851691">tableView</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.setMinWidth(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#851691">tableView</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.getMinWidth()
 - </span><span style="font-size:10.0pt;font-family:"Courier New";color:#1750eb">1</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">));<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">Button button2
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">=
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">new
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">Button(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#067d17">"Reduce 10px"</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">);<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">button2</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.setOnAction(e ->
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#851691">tableView</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.setMinWidth(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#851691">tableView</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.getMinWidth()
 - </span><span style="font-size:10.0pt;font-family:"Courier New";color:#1750eb">10</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">));<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">Button button3
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">=
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">new
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">Button(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#067d17">"Reset"</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">);<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">button3</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.setOnAction(e ->
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#851691">tableView</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.setMinWidth(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#1750eb">500</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">));<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">Button button4
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">=
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">new
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">Button(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#067d17">"Increase 1px"</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">);<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">button4</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.setOnAction(e ->
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#851691">tableView</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.setMinWidth(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#851691">tableView</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.getMinWidth()
 + </span><span style="font-size:10.0pt;font-family:"Courier New";color:#1750eb">1</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">));<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">Button button5
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">=
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">new
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">Button(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#067d17">"Increase 10px"</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">);<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">button5</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.setOnAction(e ->
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#851691">tableView</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.setMinWidth(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#851691">tableView</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.getMinWidth()
 + </span><span style="font-size:10.0pt;font-family:"Courier New";color:#1750eb">10</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">));<br>
<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">HBox row
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">=
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">new
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">HBox(</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">button1</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">,
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">button2</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">,
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">button3</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">,
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">button4</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">,
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">button5</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">);<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">row</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.setSpacing(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#1750eb">10</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">);<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">TextArea output
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">=
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">new
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">TextArea();<br>
<br>
        addWidthListeners(</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">tableView</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">,
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">output</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">);<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">VBox root
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">=
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">new
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">VBox(</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">row</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">,
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">new
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">Group(</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">tableView</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">),
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">output</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">);<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">root</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.setSpacing(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#1750eb">10</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">);<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">root</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.setPadding(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">new
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">Insets(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#1750eb">10</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">));<br>
<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">Scene scene
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">=
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">new
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">Scene(</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">root</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">);<br>
        primaryStage.setScene(</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">scene</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">);<br>
        primaryStage.setTitle(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#067d17">"Constrained Resize Policy Issue TableView"</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">);<br>
        primaryStage.show();<br>
    }<br>
<br>
    </span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">private void
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#00627a">addWidthListeners</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">(</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">TableView</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808"><</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">Person</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">>
 tableView, </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">TextArea
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">output) {<br>
        tableView.widthProperty().addListener((obs, old, val) -> {<br>
            </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">String str
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">=
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#067d17">"Table width changed :: "
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">+ val +
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#067d17">"</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0037a6">\n</span><span style="font-size:10.0pt;font-family:"Courier New";color:#067d17">"</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">;<br>
            </span><span style="font-size:10.0pt;font-family:"Courier New";color:#851691">output</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.setText(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#851691">output</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.getText()
 + </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">str</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">);<br>
            </span><span style="font-size:10.0pt;font-family:"Courier New";color:#851691">output</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.positionCaret(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#851691">output</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.getText().length());<br>
        });<br>
        tableView.getColumns().forEach(column -> {<br>
            column.widthProperty().addListener((obs, old, width) -> {<br>
                </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">String str
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">=
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#067d17">" ---> "
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">+
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#851691">column</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.getText() +
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#067d17">" : width changed to : "
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">+
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#851691">column</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.getWidth()+</span><span style="font-size:10.0pt;font-family:"Courier New";color:#067d17">"</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0037a6">\n</span><span style="font-size:10.0pt;font-family:"Courier New";color:#067d17">"</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">;<br>
                </span><span style="font-size:10.0pt;font-family:"Courier New";color:#851691">output</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.setText(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#851691">output</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.getText()
 + </span><span style="font-size:10.0pt;font-family:"Courier New";color:black">str</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">);<br>
                </span><span style="font-size:10.0pt;font-family:"Courier New";color:#851691">output</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.positionCaret(</span><span style="font-size:10.0pt;font-family:"Courier New";color:#851691">output</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.getText().length());<br>
            });<br>
        });<br>
    }<br>
<br>
    </span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">class
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">Person
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">{<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">private
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">StringProperty
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#871094">firstName
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">=
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">new
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">SimpleStringProperty();<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">private
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">StringProperty
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#871094">price
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">=
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">new
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">SimpleStringProperty();<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">private
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">StringProperty
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#871094">total
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">=
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">new
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">SimpleStringProperty();<br>
<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">public
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#00627a">Person</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">(</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">String
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">fn,
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">String
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">price,
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">String
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">total) {<br>
            setFirstName(fn);<br>
            setPrice(price);<br>
            setTotal(total);<br>
        }<br>
<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">public
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">StringProperty
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#00627a">firstNameProperty</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">() {<br>
            </span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">return
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#871094">firstName</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">;<br>
        }<br>
<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">public void
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#00627a">setFirstName</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">(</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">String
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">firstName) {<br>
            </span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">this</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#871094">firstName</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.set(firstName);<br>
        }<br>
<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">public
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">StringProperty
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#00627a">priceProperty</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">() {<br>
            </span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">return
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#871094">price</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">;<br>
        }<br>
<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">public void
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#00627a">setPrice</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">(</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">String
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">price) {<br>
            </span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">this</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#871094">price</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.set(price);<br>
        }<br>
<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">public
</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">StringProperty
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#00627a">totalProperty</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">() {<br>
            </span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">return
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#871094">total</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">;<br>
        }<br>
<br>
        </span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">public void
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#00627a">setTotal</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">(</span><span style="font-size:10.0pt;font-family:"Courier New";color:black">String
</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">total) {<br>
            </span><span style="font-size:10.0pt;font-family:"Courier New";color:#0033b3">this</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.</span><span style="font-size:10.0pt;font-family:"Courier New";color:#871094">total</span><span style="font-size:10.0pt;font-family:"Courier New";color:#080808">.set(total);<br>
        }<br>
    }<br>
}</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><b>Fix:</b></p>
<p class="MsoNormal">On investigating the code, it is noticed that there is an explicit line of code to check if the difference in widths is greater than 1px. I think this should be greater than 0px. Because we need to recompute the column widths even if the
 width is increased by 1px.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">The part of the code that need to be updated is in TableUtil.java -> constrainedResize(..) method -> line 226</p>
<p class="MsoNormal"> </p>
<pre style="background:white"><span style="color:#0033b3">if </span><span style="color:#080808">(</span><span style="color:black">Math</span><span style="color:#080808">.<i>abs</i>(colWidth - tableWidth) > </span><span style="color:#1750eb">1</span><span style="color:#080808">) {</span></pre>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span>If I update the value 1 to 0, the issue is fixed and the hBar visibility is computed correctly.</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>I have submitted a <a href="https://github.com/openjdk/jfx/pull/848" target="_blank">
pull request</a> for this fix. This is the first time I am submitting the pull request, so I am not sure about the exact process. However I do read the guidelines, and created a test case that fails with the current code and passes after including this change.
  My OCA is approved and waiting for the bot to pick it.</span></p>

<p class="MsoNormal"> </p></div><div class="m_-7341322677666418378WordSection1"><br></div><div class="m_-7341322677666418378WordSection1">Thanks & Regards,</div><div class="m_-7341322677666418378WordSection1">Sai Pradeep Dandem<br></div></div>

</div></div>