JavaFX table view headers bug?

Hi,
I created simple application with table view and I have problem with the way that table view headers are displaying.
When table view is not focused headers are improper width but when table get focus then headers width is changing and everything is working as expected.
Before table view get focus:
http://imageshack.us/a/img841/6853/j9u9.png
After table view get focus:
http://imageshack.us/a/img43/922/169f.png
Best regards,
Lukas

You should run this app without problems becouse it is embeded SQLLite databse. Look into SqlLiteDB class. You can even delete database.db file becouse sqllite driver will automatically create database.
I check your example and is perfect becouse is showing my issue You should only make small change that you skipped: ( table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); )
import javafx.application.Application;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.TextField;
import javafx.scene.control.cell.MapValueFactory;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.HBox;
import javafx.stage.Stage;
import java.util.*;
public class Main extends Application {
    @Override
    public void start(Stage primaryStage) {
        final AnchorPane root = new AnchorPane();
        root.setPadding(new Insets(10));
        final HBox controls = new HBox(5);
        final Button getDataButton = new Button("load data");
        final TextField textField = new TextField();
        final TableView<Map> table = new TableView<>();
        table.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
        getDataButton.setOnAction(new EventHandler<ActionEvent>() {
            @Override
            public void handle(ActionEvent event) {
                DataSource dataSource = new DataSource();
                table.getColumns().clear();
                table.getColumns().addAll(dataSource.getTableColumns());
                table.setItems(dataSource.getQueryResult());
        controls.getChildren().addAll(getDataButton, textField);
        AnchorPane.setTopAnchor(controls, 10.0);
        AnchorPane.setLeftAnchor(controls, 10.0);
        AnchorPane.setRightAnchor(controls, 10.0);
        AnchorPane.setTopAnchor(table, 45.0);
        AnchorPane.setRightAnchor(table, 10.0);
        AnchorPane.setLeftAnchor(table, 10.0);
        AnchorPane.setBottomAnchor(table, 10.0);
        root.getChildren().addAll(controls, table);
        primaryStage.setScene(new Scene(root, 1000, 1000));
        primaryStage.show();
    public static class DataSource {
        public List<TableColumn<Map, Object>> getTableColumns() {
            TableColumn<Map, Object> idColumn = new TableColumn<>("ID");
            idColumn.setCellValueFactory(new MapValueFactory<Object>("ID"));
            TableColumn<Map, Object> nameColumn = new TableColumn<>("NAME");
            nameColumn.setCellValueFactory(new MapValueFactory<Object>("NAME"));
            return Arrays.asList(idColumn, nameColumn);
        public ObservableList<Map> getQueryResult() {
            List<Map> result = new ArrayList<>();
            for (int i = 0; i < 200; i++) {
                Map<String, Object> row = new HashMap<>();
                row.put("ID", i);
                row.put("NAME", "Name " + i);
                result.add(row);
            return FXCollections.observableArrayList(result);
    public static void main(String[] args) {
        launch(args);

Similar Messages

  • Creating a pivot table view with two levels of headers

    Hi,
    I have a requirement in which i need to have a common heading for two or more columns.
    For Example, I have two columns like total number of loans and Total loan amount. As per my requirement, i need to give a common header 'Total loan' as the main header and amount and Count as two subheaders under the main heading in the pivot table.
    In table view, i would be able to make it using the display column and table header property. But, i need to get the same in pivot table as we have to use pivot table view instead of table view.
    Please Help me on this issue.
    Thanks in Advance
    Deepak

    Hello,
    create one column in criteria and change it's fx to case when 1=0 then Products."Prod Name" else 'Tota Loanl' end
    Now go to pivot and drag this column to Columns block of pivot. But keep this column up of Measure Labels and Now, go to column Format values.
    Mention cell horizontal alignment to Center
    see the following screenshot, Header is the column i created with the above functionality.
    !http://i852.photobucket.com/albums/ab83/kishorg86/Header.jpg!

  • Modify a Table View Header

    I need to modify the header of a tableview and I've tried this:
    .table-view {
        -fx-background-color: rgb(70,70,70);
        -fx-text-fill: white;
        -fx-border-style: solid;
        -fx-border-color: transparent;
    /*    -fx-border-insets: 0 1 1 0, 0 0 0 0;*/
        -fx-border-width: 0.083333em, 0.083333em;
    .table-view .column-header{
        -fx-border-style: solid;
        -fx-border-color: rgb(130, 130, 130);
        -fx-border-radius: 5px;
        -fx-background-radius: 5px;
        -fx-border-insets: 0 1 1 0, 0 0 0 0;
        -fx-border-width: 0.083333em, 0.083333em;
    .table-view .column-header .label{
        -fx-font-size: 12px;
        -fx-text-fill: white;
    .table-view .column-header-background {
        -fx-background-radius: 5px;
        -fx-font-family: "Calibri";
        -fx-background-color:  rgb(50,50,50);
    }However, I can not edit any table header but only the headers of each column.
    Sorry for the English and grammatical errors. I am Spanish speaking
    I put an image to make it more clear
    http://img823.imageshack.us/img823/49/tableexample.png
    Edited by: biochemistry43 on 30-oct-2012 13:17

    It is there in the CSS documentation, though it's not really very easy to pick out. See http://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html#tableview and look at the section called "Substructure".
    I'm not claiming that I get everything I need to know from the CSS docs, though. I often need to look at the default stylesheet, caspian.css, which you can extract from the jfxrt.jar file (it's at com/sun/javafx/scene/control/skin/caspian/caspian.css).
    Edited by: James_D on Nov 5, 2012 6:10 AM (fixed path for caspian.css)

  • Hide data in a table view

    Hi,
    I need to hide data in a table..Only column headers required to display.. I tried by (display column headers only) in view..It is showing only column header in the view ..But when iam displaying the table in dashboard it displays data also..another approach i took is to hide data from column properties ...Custom css display:none.. it is working fine..But the thing is it will not display data in other views also.I need to hide data only in table view..any helps will be appreciated.. Thank you

    Hi Aswin,
    Try this....
    Take columns twice and first set which is use in table view (use display:none)
    and second set use in pivot table and exclude first set columns........
    Cheers,
    Aravind

  • How do I use the option "table view" in NetWeaver 2004s Query Designer?

    Dear,
    We have used NetWeaver 2004s Query Designer, We found a strange problem. The option to select table view is not available. It is greyed out. How can you select table view (tabular) in 2004s Query Designer?
    I have read the help doc about tabular view of NetWeaver 2004s Query Designer, I check my query, it has only one structure . but the option is still greyed out. I rebuild the query with 3.x Query Designer in tabular view, and reopen it with 2004s Query Designer, So there is a tab named "tabular view" display, but the option to select table view is still not available, and when users view the query result in web , it is still not in tabular view display. So I am confused, is there a bug with NetWeaver 2004s Query Designer?
    Please help me. Thanks!

    Note 1002271. Seach this note to use key word "table view"

  • Lock rows and columns header in a table view report. It is possible?

    hi,
    I have a Dashboard that displays a report in "Table View" with many rows and columns.
    Is it possible to set a lock on the rows and columns like Excel?
    This would have blocked such headers that contain attributes and measures and to browse the report (eg with a scroll bar) had always viewed the headers.
    Can you help me?
    Thanks

    hi,
    please go through this discussion
    Re: SCROLL BAR to FREZZ HEADERS
    thanks,
    saichand.v

  • New field in a table view

    Hi experts!
    I have a problem in CRM version 6. Iu2019m trying implementing the One Click Action (OCA) in a new table view. The context node shows the original BOL structure correctly. So, I redefined the method GET_TABLE_LINE_SAMPLE and inserted the following code line:
    thtmlb_oca type crm_thtmlb_one_click_action
    The method compiled successfully. However the field THTMLB_OCA isnu2019t displayed at the list of context node and configuration tabstrip too.
    I tried putting other fields, such as names and descriptions, but they arenu2019t displayed either.
    Is it a bug in BSP_WD_CMPWB?
    Regarding,
    André

    Hi Andre,
    you still have to implement a method GET_THTMLB_OCA, because the THTMLB_OCA  is not a BOL attribute, it will not be displayed automatically by the UI Config Tool.
    The GET_THTMLB_OCA has to return a list of OCA that you want to have in table view.
    Additional to GET_THTMLB_OCA, you might have to implement GET_P_THTMLB_OCA as well.
    The P-Getter is used to determine what event is trigger if the OCA is clicked.
    Regards,
    Steve

  • Total sum to be displayed in a table view control ?

    Hi,
      I am unable to display the total sum of a column in a table view control( using HTMLB ). How should one display the sum of a column ?
    THanks in advance,
    VaraPrasad

    Hi,
    it should work once you are restricting the capacity of the out put port then it should provide that much rows only otherwise its a Bug.
    Alternativily you are tellin to disaply using sorting then add a Sort operator to the output port and the display ur output port in down order.
    But first option should work just check it again.
    On which SP u r working?
    Regards,
    Govindu

  • How to replace null as 0 in  obiee11g pivot table view?

    Hi,
    I am using obiee11g pivot table view,
    I have tried so many views but it's not work. My oracle support team also tired but could not solve it
    1.) used BIN method is that measure columns
    2.) ifnull(column name,0)
    3.) case condition:
    Case when columns is NULL then 0 else column end
    4) data formate override custom formate option
    It seems that the syntax for this custom format is positive-value-mask (semi colon) negative-value-mask (semi colon) null-mask. So this means we have a few options.
    E.g. if you want zeros (0) instead of null then enter:
    #,##0;-#,##0;0
    http://obieeelegant.blogspot.com/2011/06/how-to-replace-null-values-in-obiee.html
    Note:
    I don't want to show strike-rate and custom message in that blank cell. I want to show blank cell(null values) as 0 in the obiee11g pivot table view.
    Obiee10g version is working fine only issues in obiee11g
    Thanks in advance...
    Thanks
    Deva

    I tried this on 11.1.1.6.2 but I can't see good results.
    I choose subject area A-Sample Sales and I choose:
    T02 per Name Month on rows
    P1 Product on columns
    Measure : IFNULL("Simple Calculations"."17 Net Costs", 0)
    Prompted Year 2008
    On product Install and 2008/01 there isn't value...and I put Ifnull in my formula...
    My problem is that I want to do a conditional format when Product = Install. So I have all column with background colour except Null values...so is not pretty...
    If I add custom numeric format I can see 0 but not with background colour...
    I add a picture:
    http://imageshack.us/photo/my-images/600/tablegk.jpg/
    Any help about it??
    Is a bug on obiee??
    Edited by: Alex1 on 04-sep-2012 4:28

  • Data are not transfered to a table view using signal out

    Hi all,
    we have recently upgraded to SP16 and I'm now facing a problem on my model that worked fine when we were on SP15.
    I have a data service returning data to my model. The data are transfered to a signal out element and then displayed into a table view using a signal in element. Now the table view remains empty.
    I have checked that the dataservice returns data because if I directly connect my table view with the dataservice the data are displayed. But my requirement is to use signal in/out elements.
    This error was not appearing in SP15.
    Any ideas?
    Regards
    Panos

    After doing some tests I found out that if you have a model that has more than 2 signals in/out then the 3rd one will not work. This is definitely a bug.
    Hope that soon there will be a SP without any new bugs!

  • Migration from Designer: wrong alias for used table/view in views

    Hello,
    I am using SQL DM version 3.3.0.744.
    when importing a view from Designer, a query is build with aliases for the used tables/views which are the same as the table/view name. When using a where clause in Designer, you refer to the alias of the table/view, like t1.col1= t2.cola. Here t1 and t2 are the aliases of the underlying tables.
    In Designer the following DDL is generated:
    CREATE OR REPLACE FORCE VIEW VIEW5
    (COL2
    ,COL1)
    AS SELECT T2.COLA COL2
    ,T1.COL1 COL1
    FROM TAB2 T2
    ,TAB1 T1
    WHERE t1.col1= t2.cola
    After importing the view in Data Modeler, the following DDL is generated:
    CREATE OR REPLACE VIEW VIEW5 ( COL2,
    COL1 )
    AS SELECT
    TAB2.COLA COL2,
    TAB1.COL1 COL1
    FROM
    TAB2 TAB2,
    TAB1 TAB1
    WHERE
    t1.col1= t2.cola ;
    So by using the wrong alias, the where clause is invalid and the query builder doesn't show the joins.
    The solution for this is to use the alias of the used table/view instead of the table/view name. Can you raise a bug for this?
    Thanks in advance,
    Joop

    Thanks for your time. I did all possible way, but still the same problem. I mean
    EXP 8... IMP 8
    EXP 8... IMP 9
    EXP 9... IMP 9
    Today I found that, NLS_LANG of two databases are different. Oracle 8i is : WE8ISO8859P1
    AND Oracle9i is : WE8MSWIN1252
    So I created a new database from scratch with Oracle 8i character set :WE8ISO8859P1 and then use imp9i to import the file. Still the same problem.
    Thanks,
    Arash

  • Sorting on Table view 11g

    Hello -
    I need to sort the table view by the sub-totals. So if I have a table view like
    Car     red     2
         blue     2
         green     2
    Total Car          6
    Bike     black     5
         blue     5
    Total Bike          10
    Trucks     Yellow     3
         Grey     4
    Total Trucks          7
    And I want to sort them on the subtotals. My expected report should be like:
    Bike     black     5
         blue     5
    Total Bike          10
    Trucks     Yellow     3
         Grey     4
    Total Trucks          7
    Car     red     2
         blue     2
         green     2
    Total Car          6
    When I do Sum(measure by Vehicle), and sort on it, I loose the grouping (or suppression of data) for Bike, Car and Trucks. What I get is:
    Bike     black     5     10
    Total Bike          5     10
    Bike     blue     5     10
    Total Bike          5     10
    Trucks     Yellow     3     7
    Total Trucks          3     7
    Trucks     Grey     4     7
    Total Trucks          4     7
    Car     red     2     6
    Total Car          2     6
    Car     blue     2     6
    Total Car          2     6
    Car     green     2     6
    Total Car          2     6
    Is this a bug that the suppression on the column is lost or am I not following some steps. I dont want to put this in a pivot table view.
    Thanks in advance.

    Hello -
    I need to sort the table view by the sub-totals. So if I have a table view like
    Car     red     2
         blue     2
         green     2
    Total Car          6
    Bike     black     5
         blue     5
    Total Bike          10
    Trucks     Yellow     3
         Grey     4
    Total Trucks          7
    And I want to sort them on the subtotals. My expected report should be like:
    Bike     black     5
         blue     5
    Total Bike          10
    Trucks     Yellow     3
         Grey     4
    Total Trucks          7
    Car     red     2
         blue     2
         green     2
    Total Car          6
    When I do Sum(measure by Vehicle), and sort on it, I loose the grouping (or suppression of data) for Bike, Car and Trucks. What I get is:
    Bike     black     5     10
    Total Bike          5     10
    Bike     blue     5     10
    Total Bike          5     10
    Trucks     Yellow     3     7
    Total Trucks          3     7
    Trucks     Grey     4     7
    Total Trucks          4     7
    Car     red     2     6
    Total Car          2     6
    Car     blue     2     6
    Total Car          2     6
    Car     green     2     6
    Total Car          2     6
    Is this a bug that the suppression on the column is lost or am I not following some steps. I dont want to put this in a pivot table view.
    Thanks in advance.

  • Help on Table View

    Hi Experts,
    This requirements seems to be a bit different but the user needs it this way.
    I have transaction data in a table format which crosses 10000 records.
    I have created a simple request and have called this request in dashboards.
    As the data is more the user looses the track of what column is he looking when he /she scrolls down.
    User wants to display the column headings at the end also.
    IS there anyway where i can display only the column headings and not the data.
    So that i can create such request and call this in dashboard also.
    Let me know if i need to be more clear.
    Appreciate your immediate response.
    Please treat this as an immediate requirement.
    Regards,

    Don't know if this will satisfy your needs... and you can always play with it to improve the final outlook, but take a look at this:
    You say you have a Table View and want the headers at the bottom of your report as well.
    1) Create a Duplicate Table View.
    2) In the Properties of Table:2 view, change the Rows per page to 1. (I tried 0, but it didn't work for obvious reasons.)
    3) Click on the Background Color and change the color to the color of the values (most likely black). This will black out the one row of data that unfortunately I couldn't find a way to get around.
    4) Click on Additional Formatting Options and enter 100% for the width. Do the same for the original Table View. This step will help the columns line up properly.
    5) Go to Compound Layout View and add the Table:2 View at after the original Table View.
    Voila, you have the headers at the end of the report. Not the most elegant solution, but if it works for you, great.

  • Excluding a column causes non-repeating values in 2nd table view

    I have an analysis (11.1.1.5) that has these columns: Month, Country, State, City, Sales, Country Sales, Share of Country. Country Sales is a level-based measure that returns sales at the Country level. Country, State, and City are a hierarchy as you might expect.
    When I display the initial Table view for this analysis, the Country Sales column shows a value on every row.
    When I create a 2nd Table view and exclude the City column from that view, the Country Sales column now only shows a value for the first State within each Country. In other words, each value of Country Sales is shown only once, and is NOT repeated on each subsequent row for that country.
    Any ideas if this is a bug, or if it was intentionally designed this way for some reason? Is there a way to force the values to repeat? (Green Bar / Repeat doesn't do it.)

    Thank you for the responses, guys. Still no luck.
    I moved the Country Sales column as Deepak suggested, both in the criteria and in the view. That didn't change the results. I also started fresh with a new analysis, and placed the columns in the suggested positions from the start. Still no change.
    New information: I tried excluding State and leaving City in the table view. Got the same goofy results - Country Sales did not repeat.
    More new information: I added a Brand Revenue measure to the Sample Sales subject area. Brand Revenue is defined as '1 - Revenue' at the Product Brand level. Created a similar view, and it worked fine.
    I'll investigate what the differences might be between Sample Sales and my repository. Hard to imagine what it might be. My repository is very simple and straightforward.

  • How to not display the column header in the table view?

    I do not want to display the column header in the table view, how can I achieve it?

    If you're using JavaFX 8 you can use the following in an external style sheet:
    .table-view .column-header-background {
      -fx-pref-height : 0 ;
    If you're using JavaFX 2.2, the -fx-pref-height attribute is not available in css, so I think you have to resort to a lookup:
    final Region tableHeader = (Region)table.lookup(".column-header-background");
        tableHeader.setPrefHeight(0);
    As always, I feel obliged to point out that I don't really like lookups. Sometimes they seem to be the only way, though.

Maybe you are looking for