JavaFX table view with slider - java

I need to make table view for large table. There are about 20 columns and it is the problem for me because I do not know how to make some kind of a slider to make possible looking at any column I want.
Now I am not able to see all column because my screen is to small. I would like to have "resaizable" tableview.

Related

draw layout widget on libgdx

I am almost new on LibGDX
I need to draw an overlay on my game like this one:
There is a background, 2 text and a botton
I would like to draw it using a class and reuse it in many part of my game.
I try to extend a "stack" class but is not good.
Also I would like to add the class into a table so probably I need to extend an actor
Can somebody tell me witch layout/class/widget is the best to achive this?
Thanks
If your layout will be similar to the image you posted, you could use a Table for that.
https://javadoc.io/static/com.badlogicgames.gdx/gdx/1.11.0/com/badlogic/gdx/scenes/scene2d/ui/Table.html
I often use nested Tables if I need to span multiple columns/rows instead of trying to do everything in one Table. This makes things easier to work with IMO.
For the example image you posted, you could use two tables. Table1 is the entire widget and Table2 has the two Label (text) items. Then you can set the background on Table1, which will place the background behind everything in the table.
To layout each item in the Table, the Cell (part of LibGDX's Table) is typically used for this. You can set size, alignment, padding, spacing, etc. on each cell of the table to get the layout you want.
For example, to add a padding of 20 to the left side of the button:
table1.getCell(button).padLeft(20);
Here is the API for Cell.
https://javadoc.io/static/com.badlogicgames.gdx/gdx/1.11.0/com/badlogic/gdx/scenes/scene2d/ui/Cell.html

Jface tableviewer - Columns are not spaced out even with tablecolumnlayout

I am using a jface tableviewer with a tablecolumnlayout (for it's parent composite) in my eclipse RCP application.
I see that, in my view, the columns are equally spaced out to cover the entire width of the table.. So far so good.
We have a functionality where we need to save & load the table layout . Basically user can hide/ re-order any number of columns and he wishes to save that particular layout..
I am using the eclipse preferences API to save/retrieve the table layout.
The view opens with a default layout (with all columns & with the default ordering ) when the view is opened for the 1st time. Hence, I would save a DEFAULT layout(with the default ordering & column widths) whenever the view loads so that user can come back to the original layout at any time.
But, the problem here is when I try to load the default layout, I see that the columns are NOT equally spaced out and there is an empty column at the end.
What can i possibly do to achieve the default behaviour where columns get equally spaced out to cover the width of the table?
Note: I tried invoking the layout() of table's parent composite or calling the redraw of both table as well as composite but it did not work out.
I solved the above mentioned issue.
SWT increases the given width of the columns during view rendering so that the entire table width is occupied.
I was able to get the increased width of each column only when the view was about to be rendered (during part Activation ).
If I asked for the column width just after using the tablecolumnlayout, I was still getting the predefined width.
As a solution to this, I moved my code to save the default layout during part activation so that the actual increased width is obtained.

How can I wrap a table view in javafx when its size is more than my screen's size?

I have a table view whose size is more than my screen size.
To view that table I have 2 solutions
1-I have to provide a scrollbar by which user can scroll to the end of the table
2-Or warp the table when it meet the end of the screen.
First solution-I don't want to provide any scroll bar as I want user to view the table at one shot. so I want to wrap the table.
I searched and came to know that I could warp table header but I could'nt find any hack to wrap the whole table. Any help on this will be great help for me

GWT Celltable fixed columns

Is there a way to make, let say first 3 out of 7, columns fixed in Cell table. I want to be able to see always first three columns and have horizontal scroll on others.
You will have to create a custom widget that consists of a ScrollPanel, which includes two CellTable widgets set side by side. The right table should be wrapped in a FlowPanel with overflow-x property set to AUTO (overflow-y should remain at HIDDEN).
You can use the same DataProvider for both tables to synchronize all changes. Be careful with the SelectionModel though, if you need it. I would limit selection to the first column of checkboxes and disable selection by clicking on a row.
Make sure that your widget fits into its space, or you may end up with two horizontal scrollbars - one for the ScrollPanel and one for the right table. Finally, remember to set sizes on both tables so that they have the same height.

set scroll bar position in JTable/SWT Table

I would like to ask question that is not directly related to any technology but it’s a logic level question. Forgive me if I am wrong.
I am trying to solve this issue in Java side.
We have a list view (may be JTable or SWT Table). We are displaying records from a table in to that list. The table may have millions of records. And the table size is keeps increasing. As the table size is huge and it keeps increasing we are keeping a cache of 3000 records and displaying the cache in the table. So at a single point only 3000 records will be there in the view. At this time, the scroll bar of the view (JTable or SWT Table) shall be set based on the cache only (in this case 3000 records).
And based on the user events like, PgUP, PgDwn, DownKey, UpKey, Mouse Scroll etc we are refreshing the cache so that the view will be refreshed.
But we need to give users an actual feel that the scroll position based on the records in the table. I think it is not possible as the scroll position is set by the OS based on the number records in the display. Can somebody can assist me with an alternate method. If I am not explained my question correctly, I will explain this in details. Please help.
Usually a scrollbar is set at the top of the list, or at the bottom, depending on if the property "AutoScroll" is set to true or false.
I believe there IS a method where you can set the scrollbar at a specific point, but last time I tried using it, it was kinda clunky.
It sounds like you're trying to make the scroll bar do two things at once, and that can be confusing. You could use a separate control to the do the paging. A row of buttons in a JToolBar looks nice, but a JComboBox will take up less room. There's some good answers about this here.

Categories

Resources