JavaFX 2.0 :: TableView - Misalignment Between Header And Content

May 23, 2014

I am facing an issue with the TableView in Java FX 8.
 
I am having a TableView created with data with scrollbars automatically added in when the Window is minimized.
I moved the horizontal scrollbar to right and then maximized the window to full.

After this the column headers remained no longer aligned with the content. When I click on any column header then the header aligns with the content.
 
The Issue is replicable also in case when a vertical scrollbar gets automatically added to a table view with preloaded data...

View Replies


ADVERTISEMENT

JavaFX 2.0 :: Tableview - Width Of Columns Computed For Content Of Cells And Ignoring Header

Nov 20, 2014

I'm using the tableview-component. The size of font of header is greater then that of cells. The problem is: the width of the column bases on the cell with the longest string and if the header-string is longer then the header gets truncated (it shows ellipsis) and I have to change the width of column manually. How could I solve this problem? The easiest way would be to compute the column-width on myself. I can't find any method in javafx, that would allow to compute the width of string in pixels. In Swing there is the FontMetrics class and Graphics class, so it is easy to get the width in pixels. Are there any pendants to this classes in JavaFX?

View Replies View Related

JavaFX 2.0 :: Round Corner In TableView Header

May 20, 2014

I'm doing a bit of styling in TableView. The result is quite nice but I can't make the left top corner round. This is the actual result:
 
[URL] ....
 
And this is the css :

.table-view {
    -fx-background-color: transparent;   
}
/*HEADER */
.table-view .column-header{      

[Code] .....

I would also like the top left corner was round.

View Replies View Related

JavaFX 2.0 :: Style Column Like Header In TableView

Jul 5, 2014

I have a column of my TableView that just shows row numbers, and I would like to style the cells in that column so that they appears just like a column header (so the same styling as the headers use). I presume there is some simple way to do this by tapping into the right style class, but I am not sure which one.

View Replies View Related

JavaFX 2.0 :: Change Arrow Color On Header Of TableView

May 20, 2014

is possibile to change the color of the sorting arrow that appears in the columns of the Table View by css? My attempts have failed and I have not found any documentation, nor is there any reference in the Modena css.

View Replies View Related

JavaFX 2.0 :: TableView Cell Colouring

May 12, 2014

Here is another cell colouring question with a different take. Say you have a TableView with three columns - Category, In and Out. You add an empty row and then you start editing the Category column. When you have added a category you would like to see a change in the colour of the other two column cells in the same row depending on the category value. 
 
Say if the category is 'income' then the 'In' cell will become green and the 'Out' cell becomes red. The important point here is that these cells and the underlying domain object does not have any values associated with these columns yet. The cells are empty and colour change is to show the user where the value should be put for the given category (into the green cell ).
 
Therefore after the category value is committed a 'message' needs to be propagated from the category column to the current row (or the whole table) to repaint itself. I have tried calling the following methods from the Category column's 'commit()' method but neither of them triggers a repaint:
 
- getTableRow().requestLayout();
- getTableRow().updateTableView(getTableView())
- getTableRow().updateIndex(getTableView().selectionModelProperty().get().selectedIndexProperty().get());
 
Once the re-paint is triggered then both In and Out column table cells can take the current category value from the underlying domain object (say MyRecord) like this
 
        MyRecord record = getTableView().getItems().get(getTableRow().getIndex());
         String category = row.getCategory();
and call the setStyle(".....") on the cell to change the colour.

View Replies View Related

JavaFX 2.0 :: FXML Tableview - Displaying Data?

May 9, 2014

I have an FXML table view. And I want to assign value from an tableview create on class to FXML tableview. But at the end is not displaying data.
 
Example:
  
@FXML private TableView fxmlTable;
             private  TableView insideClassTable;
public class SomeClass
{
     public SomeClass(){
          insideClassTable = new TableView();
         //////////////////////////////////////////////////
               Filling insideClassTable with data.
         //////////////////////////////////////////////////
             fxmlTable=  insideClassTable;
               } 
// some other code and main
}
 
If I set value to fxmlTable, data are display correctly, but if assign value to insideClassTable first and then make fxmlTable=insideClassTable they are not display.

View Replies View Related

JavaFX 2.0 :: How To Define Indeterminate CheckBox In TableView

Jun 6, 2014

I would like to defined a TableView with a column containing a CheckBox.

This can be done with an instruction like this : myColum.setCellFactory(CheckBoxTableCell.forTableColumn(myColumn);
 
The problem is how to specify that the displayed CheckBox is an indeterminate one ?

View Replies View Related

JavaFX 2.0 :: TableView With Dynamic And Updatable Columns

Jan 30, 2015

I am trying to code a TableView with dynamic columns and I saw a lot of examples like this one: Creating columns dynamically. But any of those would work for my needs.
 
Its very simple:
I got a List of Customers, and each one has a List of Buys.
A Buy has a String "buyDetail" and a Date for the ship.
 
My TableView need to have the first column with the name of the Customer, and one column more for every day of existing ships. We don't know previously which days will be used. If the amount of money is superior of 100, for example, I need to be able of applying different styles.
 
Example:
Customer2015/01/022015/01/032015/01/09Morgan$400 (buyDetail)0$100Luis00$20Steven$1000Hulk0$5$32 

I cant use the Properties because i dont know how many Buys will have each Customer.
 
My best try (only for the first column) was this, but I cant get the Buy updated if I edit the value in the cell: I didn't try to write the others columns code because I feel that im doing it really wrong.. This Shows the Customer´s names, but I cant handle if that data is edited.

table = new TableView<Customer>();
ObservableList<Customer> lista = FXCollections.observableList(registros);
table.setItems(lista);
TableColumn<Customer, Customer> customerNameColumn = new TableColumn<Customer, Customer>("");
 
[Code] ....

View Replies View Related

JavaFX 2.0 :: How To Listen To Change In CheckBox In TableView

Dec 28, 2014

I created two CheckBox in 2 tableColumn and I want to listen theire change. I tried

col_orien.setOnEditCommit

But it doesn't work (col_orien is the name of the tablecolumn that contain the check box)

Here is my code :

     col_orien.setOnEditCommit(new EventHandler<CellEditEvent<Information,Boolean>>() {
       @Override
       public void handle(CellEditEvent<Information, Boolean> event) {
         System.out.println("Edit commit");
       }
     });

View Replies View Related

JavaFX 2.0 :: Loading Large Data Set Into Tableview?

Jun 19, 2015

I have a huge data set 10000+ rows which I need to show in the tableview. It take a lot of time to render the UI and is slow. 

View Replies View Related

JavaFX 2.0 :: How To Bind rows Height Of Two Tableview

Jan 20, 2015

I want to use to tableview one beside the other  so that they appear as a single table.  but I do not find how to bound the height rows of the two tableview.

View Replies View Related

JavaFX 2.0 :: How To Enable Multiselection In TableView Via Mouse Drag

Jun 11, 2014

I have multiselection working in my TableView but only via shift-click or using the keyboard but how do I enable the selection of several table rows via a mouse drag? It does not seem to work out of the box.

View Replies View Related

JavaFX 2.0 :: TableView Single Cell Selection Styling

Jun 6, 2014

TableView selection model allows selecting single cells in the table but the default styling highlights the whole row regardless of the actual column selected in the row.

I am just wondering what options are there to change this behaviour so that the actual cell (row/column) get highlighted rather then the whole row.

Something like the $18,000 cell in the  "Figure 1 Table overview"  in [URL] ....

View Replies View Related

JavaFX 2.0 :: Styling A TableCell To Indicate Focused Cell In TableView

Sep 15, 2014

I am trying to style the TableCell that has focus in a TableView to simulate how Excel does it. Excel uses a white background with a 3px black border which seems to be centered on the nominal cell edges. That is (and this is issue I am having), the border extends outside of the nominal cell boundaries.
 
My first naive attempt was to to override the CSS for .table-cell as follows:
 
.table-cell:selected:focused
{
  -fx-background-color: white;
  -fx-text-fill: -fx-text-base-color;

[Code]....

Doing this fixed problem (1) from the first attempt since this approach tweaks the background colors without affecting overall TableCell size. However, it still puts the black border completely inside the cell. My attempt to set -fx-background-position to a negative value in an attempt to offset the background seems to be ignored.
 
Having done this before using a Flex AdvancedDataGrid, my solution was to add a layer on top of the grid which renders the focus rectangle. I wonder if I would have to do a similar thing here.

View Replies View Related

JavaFX 2.0 :: Create List Of Entities - Multi-row Tableview?

Apr 10, 2015

I would like to create list of entities which is populated by a search function with the data coming from our REST webservice. However I would like it to be multi-line, with the first line being details from the entity itself and the second line buttons for options that can be performed.
 
So as an example say my entity is People, the first line would contain columns for first name, last name, gender, DOB, etc. The second line would be buttons for "Edit Person", "Print Person details".   With the standard TableView I can't see anyway to alternate between one row of data and another row of buttons.

View Replies View Related

JavaFX 2.0 :: TableView - Keeping Track Of Topmost Visible Row

Apr 1, 2015

I have a TableView and it is scrolled to have some rows visible. Lets call the top visible row T, and the bottom one B.

I now replace the items in the TableView with a whole new list of items (so new data to view), but I want to scroll back to either T or B.

It seems to me that I have to somehow keep track of the topmost visible row, or the bottom-most visible row, but I can't figure out how to do that.

View Replies View Related

JavaFX 2.0 :: How To Dynamically Load Image Into TableView When Its Row / Cell Becomes Visible

Jan 24, 2015

I am building an application that shows tables with large amounts of data containing columns that should display a thumbnail. However, this thumbnail is supposed to be loaded in the background lazily, when a row becomes visible because it is computationally too expensive to to this when the model data is loaded and typically not necessary to retrieve the thumbnail for all data that is in the table.
 
I have done the exact same thing in the past in a Swing application by doing this:
 
Whenever the model has changed or the vertical scrollbar has moved:

- Render a placeholder image in the custom cell renderer for this JTable if no image is available in the model object representing the corresponding row
- Compute the visible rows by using getVisibleRect and rowAtPoint methods in JTable
- Start a background thread that retrieves the image for the given rows and sets the resulting BufferedImage in a custom Model Object that was used in the TableModel (if not already there because of an earlier run)
- Fire a corresponding model change event in the EDT whenever an image has been retrieved in the background thread so the row is rendered again
 
Btw. the field in the model class holding the BufferedImage was a weak reference in this case so the memory can be reclaimed as needed by the application.
 
What is the best way to achieve this behaviour using a JFX TableView? I have so far failed to find anything in the API to retrieve the visible items/rows. Is there a completely different approach available/required that uses the Cell API? I fail to see it so far.

View Replies View Related

JavaFX 2.0 :: Dialog Header Text In Bold

Apr 14, 2015

I am using the JavaFX dialogs. I have made a dialog as follows:
 
     Alert d = new Alert(AlertType.CONFIRMATION);
     d.setTitle(Resources.R(Resources.DELETE_DATA_SOURCE));
     d.setHeaderText(...);
 
I want to make part of the header text bold -- I want a message like "Really delete X" where X is in bold.
 
Is there any way to do this with a dialog (other than rolling my own?).

View Replies View Related

JavaFX 2.0 :: How To Prevent User From Leaving Tableview Editing Cell In Case Of Errors

May 14, 2014

I have a TableCell that will hold numbers in a tableview. All is working work nicely, but I want the following behavior:
 
- when the user begins to edit such a cell, if it doesn't enter a number, the cell will not call commitEdit, but rather display a red border and prevent the user from changing the focus to anything else until he either: enters a correct number or presses ESC.
 
I don't know how to keep the user in that editting cell if while he has an incorect number. Currently he can click other row/control and he will break the edditing state. I repeat, I don't want the user to be able to click on any row/control until he has a correct number.

Here is my cell implementation:
 
public class EditableIntegerCell extends TableCell<Person, Integer> {
    private TextField textField;
    @Override
    public void startEdit() {
        if (!isEmpty()) {
            super.startEdit();
            createTextField();
            setText(null);

[Code] .....

View Replies View Related

JavaFX 2.0 :: Adding Tooltip On Cell Of TableView In Order To Show Some Information To User

May 21, 2014

I'm trying to add a tooltip on a cell of a TableView in order to show some information to the user.
 
This is the code:

colonnaColore.setCellFactory(param -> {
            TableCell<Appuntamento, Template> cell = new TableCell<Appuntamento, Template>() {
                @Override
                protected void updateItem(Template item, boolean empty) {
                    // calling super here is very important - don't

[Code] ....
 
In few words: there is a cell factory on the cell to show a colored box, then I added a tooltip to the cell. I need informations that are in the item added to the TableView that has type "Appuntamento". So I try to get my element with these code (that in others part of my code works); but here I get a Null Pointer Exception on cell.getTableView() and also on cell.getTableRow().
 
I'm probably using these methods in a way that was not expected.

View Replies View Related

JavaFX 2.0 :: How To Bind The Content Of A ListProperty

Feb 2, 2015

Is there an existing way to bind the content of a ListProperty?  Consider the following:
 
private final ListProperty<Worker<?>> workers = new SimpleListProperty<>(FXCollections.observableArrayList());
    public ListProperty<Worker<?>> workersProperty() {return workers;}
    public ObservableList<Worker<?>> getWorkers() {return workers.get();}
    public void setWorkers(ObservableList<Worker<?>> workers) {this.workers.set(workers);}

[Code]...
 
What I want to do is bind the content of the stateWatchedWorkers list to workers.  If the entire workers list is replaced, I want stateWatchedWorkers to be updated to match the content of the new list.  Put another way, I want the stateWatchedWorkers list to be mapped to the current list being held by the workers property.

View Replies View Related

JavaFX 2.0 :: Float Modeless Popup On Top Of All Other Content

Jun 1, 2014

I have a case where I want to float a modeless popup on top of all other content. Seems like a Popup is ideal for this. Except for the following annoyances:
 
I don't see any way to tie its position to some owner window. You can supply an initial anchor position, but I noticed that if I drag the frame of the app window containing the JavaFX application, the Popup remains where it is and can actually appear outside the bounds of the App! I find this very disconcerting. I suppose I could bind its position to the screen coords of the Stage, but it would seem that I should not have to do this.If I minimize the app, the Popup remains visible. Rather odd given that when I called Popup.show(Window), you would think when the owner Window got hidden it would hide the owned Popups too. Again, I could probably bind to some property on the Stage, but like (1), it seems you should not have to do this. 
 
I haven't tried this while embedding the Scene in a browser. I certainly hope that these Popups should not be allowed outside the bounds of the browser window. That spells trouble.

View Replies View Related

JavaFX 2.0 :: Loading Localized Versions Of FXML Content?

Nov 25, 2014

I am trying to figure out the best way to load localized versions of FXML content. I know that I can localize strings, images etc. by specifying a ResourceBundle when loading the FXML using FXMLLoader with a ResourceBundle. But what about if you need to tweak the FXML for different locales (eg, adding more real estate for certain elements, different fonts, etc). Is there any way to create localized versions of FXML content? The only thing I can come up with is a naming convention like MyForm.fxml, MyForm_de_DE.fxml, ... and trying to load them based on the locale, but I'd have to come up with my own fallback for specific locales that aren't found.

View Replies View Related

JavaFX 2.0 :: How To Avoid Scaled ScrollPane Content Panel From Being Centered

Nov 19, 2014

I want to create a ScrollPane where I can scale the contents. Think of a simple drawing program that allows you to zoom in and zoom out.
 
If I create a ScrollPane in SceneBuilder and then drop a couple of Circles into the AnchorPane all looks good.
 
If I then set a scale of 0.5 for the AnchorPane Scale X and Scale Y the AnchorPane gets scaled about its centre leaving space between the left and top edge of the AnchorPane and the left and top edge of the enclosing ScrollPane.
 
The only way to get the AnchorPane so that it aligns with the top left of the ScrollPane seems to be to add a negative amount to Translate X and Translate Y.
 
In my application I would like the user to be able to adjust the zoom (Scale) continually and also the size of the AnchorPane must be allowed to change as the user add/deletes/edits content.
 
Does this mean I have to continually monitor the AnchorPane properties and set compensating Translate X and Translate Y values each time? Or is there an easier way to achieve what I want?

<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.paint.*?>
<?import javafx.scene.effect.*?>
<?import javafx.scene.*?>
<?import javafx.scene.shape.*?>

[Code] ....

View Replies View Related

Reading A File Header / Hex?

Mar 3, 2013

how to get the first few hex symbols of a file in java, for example if i input a pdf into my coding i want my program to output, e.g "25 46 44 38" ....

I have been able to print out the hex of a whole file but not managed to set a maximum read limit so that my code only takes a certain amount of values ....

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved