The textarea-class in JavaFX should give me the option to add rows and columns, but the way I tried didn't work:
TextArea ta = new TextArea();
ta.setPrefRowCount(100);
ta.setPrefColumnCount(100);
I'm searching for columns/rows like in Microsoft Excel, inclusive the gridines.
.setGridLinesVisible(true);
doesn't work for this Type.
For use case similiar to Excel you're actually looking for TableView. Every table cell can contain anything, even another window so it is very flexible.
If you want grid lines on top of TextArea, but want to keep the standard TextArea behavior, you will have to combine the TextArea and TableView in a StackPane.
You will just have to clear the table's background using CSS.
However, matching the row and column sizes with the text will need some additional code.
Apologies for my English.
colums/rows like in Microsoft Excel, inclusive the gridines
TableView as recommended in Michael's answer is likely the right basic solution for.
There are some 3rd party controls you might consider which add some basic spreadsheet like functionality to the base JavaFX TableView control:
SpreadsheetView from the ControlsFX project.
TiwulFX from Panemu.
Related
I have another question regardless PF Extensions. Is it possible for example in one particular column to display custom (generic) column type. For example datePicker, Textarea, DecimalNumber, just Text or DropDown Menu. So for every single row it can be different content in this column. Is this idea possible or not really? Many thanks!
This issue has been raised before and its not so simple with the HandsonTable. Its doable just not simple.
See: https://github.com/primefaces-extensions/primefaces-extensions/issues/136
I'm playing around a bit with Kendo UI for Angular and can't seem to find an easy way to disable sorting on specific columns of a grid.
There's an allowUnsort in sort-settings.d.ts, but I'm uncertain on how to use this (and this appears to relate to removing sorting afterwards, not from the start).
Or perhaps I'm simply using the grid wrong, that's also possible..
My situation is as follows:
I'm trying to use a grid to display some rows, and depending on the type of data, it should render a different icon in the first column. Also, I'm not using a 'real' header in that column, but replaced it with a button to create a new row.
To get my button in the header, I use a <template kendoGridHeaderTemplate ...>...</template>. This always seems to add a link around the header cell if sortable is enabled, which is what I'm trying to avoid (in some cases).
Is there a way around this?
Setting [sortable]="true" for the Grid component will enable sorting globally. Then you can fine-tune which column has sorting by disabling it per column, i.e [sortable]="false"
Here is a quick example:
http://plnkr.co/edit/hLbzC5jKJwVdMtRmh0cH?p=preview
I have a multi-column list box control embedded in Excel, is there a way to change the background, font, and other attributes of an individual cell (rather than changing all the text in the listbox)?
I don't mind which listbox control I use (activeX or otherwise).
I would also consider using another control that isn't tied into the excel worksheet rows and columns (i.e. I can't use a table).
Excel's built in listbox control doesn't really have formatting options, but you can do quite a bit with the listview control.
You'll have to add a reference to Microsoft Windows Common Controls 6.0 (from VBA window go to Tools and click References, and scroll to find it). There's not an effective way to change the background color of a single cell in the listview table, but you can change the font color and make text bold in specific cells or based on criteria.
The syntax to populate the listview is a bit different than listbox, but there's quite a bit of material online for this if you think its the way to go. Also - I have only used listview in a form, but it should be possible to add this as an ActiveX control in an actual sheet.
I'm working in a project and use LWUIT, I want to make a custom style for Combobox and Successfully after a lot of search I have made it by changing the cell renderer and the look and feel to change arrow icon
the problem now that the white space around my items I want to remove them, how can I do that please
You should start setting the padding/margin entries for various styles to 0, we changed the styles here a bit at Codename One so i don't quite recall everything but try PopupList, PopupItem, ComboBoxPopupList, etc.
How can I create a table in which I can add rows and columns dynamically?
How can I make cells of that dynamic table editable? I.e. I should push Edit Command button and write texts or numbers in the cell.
Take a look at LWUIT which has one of the best listview implementations in J2ME
Although it is old, you may take a look at MicroCalc to get some ideas about the implementation.
It is a spreadsheet implemented in J2ME under GPL license.
AFAIK, there is no such UI control that is available in MIDP, you should either create the control or use some library such as J2ME-Polish