I have JavaFX 2.2 TableView component and need to Scrollbar set visible always.So how can I set visible Scrollbar to always in TableView using JavaFx css or as a TableView property in fxml?
Related
I have a Vaadin 8 application with several views.
public class ViewName extends Panel implements View {
There is a VerticalLayout as main layout in the panel.
public ViewName() {
setSizeFull();
VerticalLayout mainLayout = new VerticalLayout();
setContent(mainLayout);
Then I have many different layouts (HorizontalLayout, GridLayout) or Components such as Label being added as components to the mainLayout. For the HorizontalLayouts I often do the following to use the full width of the screen:
hLayout.setWidth("100%");
I have a lot of icons, grids etc. Everything is OK as long as I don't resize the window.
When I resize the window to a small size I get a mess (icons, text etc. on top of each other) and no horizontal scrollbar. (However, the grids get horizontal scrollbars.) I have tried many things to fix this. If I add
mainLayout.setSizeFull();
or
mainLayout.setWidth("100%");
I have a mess on the big screen already. I also tried the CSS for the mainLayout as described here. I get several scrollbars but none for the window itself!
The only component that resizes correctly is a Label added to the mainLayout, e.g.:
Label title = new Label("Some text",ContentMode.HTML);
title.setWidth(100, Unit.PERCENTAGE);
mainLayout.addComponent(title);
mainLayout.setComponentAlignment(title, Alignment.MIDDLE_CENTER);
I also noticed that anything in a GridLayout seems to stay in place after resizing but is not vissible since I have no scrollbar. However, icons in a HorizontalLayout get on top of each other.
What is wrong? Please, I need a general instruction on which layout I should use as main layout for my view panel, how to size the components and how to get ONE horizontal scrollbar for the main window if necessary.
The problem is that you are setting the width of your mainLayout to the width of your view. This means, that your mainLayouts width will never be bigger than your views width. So no scroll bar will appear.
According to the information you posted, changing your mainLayouts width to undefined should fix the problem.
mainLayout.setWidth("-1px");
While exploring the basic concepts of JavaFX, the following question arose:
Is there a way to customize the layout of composite controls (such as TreeView or Accordion)?
For example, to achieve a horizontal arrangement of child elements or to introduce animations.
Some controls include API for controlling their layout. For example, you can set the orientation of a ListView to Horizontal or Vertical or switch animation on or off in a TitledPane.
You can write your own skins to apply to existing controls and modify their layout.
Public API for control skinning is provided in Java 8.
Use the -fx-skin attribute to change a skin via css.
More details are in the JavaFX wiki control skinning section.
Using custom skins you can completely change the layout and animations for a control. See for instance this carousel skin of a TreeView.
I'm currently testing the integration of some JavaFX2 components in to a swing application.
I have a JFXPanel which contains an HBox Pane which holds a list of buttons. What I'm trying to achive is to hide and show some buttons and resize the HBox and the JFXPanel. Problems I'm facing:
When a hide some buttons, the HBox does not resize itself.
I can modify HBox size (using resize method) but I must specify the
dimensions (no automatic resize) the underlying JFXPanel does not
resize. The autosize method does not seem to acomplish this either.
So, How can I resize it ? I'm using FXML and controllers so I see no easy way of resizing the JFXPanel but I'm trying to see how can I manually set it, but how can this be done automatically ?
By the way, I'm not using absolute positioning in swing (no layout manager).
Try to remove the button from the HBox, not just hide it.
I have done the same with a ToolBar & it update its size when buttons are added or removed.
There is a panel with anchor layout used for vertical sizing.
Inside the panel there is a horizontal buttongroup.
Is there a way to set fixed width or better make the width depend on buttons?
In my case it is always stretched to the size of the window.
There is the same problem with the grid inside the panel.
Thank you.
Making the width dependent on the buttons is handled by the layout itself. If you have an hbox layout, each of the items inside the container (say, buttons) will automatically occupy the width.
I have a Xib set up for the Master view in a UISplitViewController. The Xib has a view with two subviews: a subview of a UIImageView (that contains the background image) and a grouped style UITableView. When testing, the image view does not show up as the background of the table view.
The background image shows up correctly using the exact same Xib with the iPhone.
Things I have checked:
Table view's background color is set to Clear Color
Opaque checked or unchecked has no effect (on the UIView, UIImageView, or UITableView)
Setting the Alpha to < 1.0 on the UITableView does start to show the UIImage view behind it
Tested on 3.2 and 4.2
Any ideas on why the UIImage view is not showing up in the background on the iPad (but is okay for the iPhone)?