JavaFX - Make TitledPane Sortable - javafx

Is there a plugin or something else to make a TitledPane sortable like this https://jqueryui.com/sortable/ or this ?

Related

How to do a JavaFx textfield no focusable?

I'm using JavaFx and have a popup window to edit / create.
When the action is to edit, I need that some fields won't be selectables nor editables, what method i can use to do it?
Note: to do no editable, I'm using:
fieldname.setEditable(false);

javafx deleting contents of an accordion pane

I have an accordion pane which contains three titled panes. I wish to delete these in the java program, however the Accordion object doesn't seem to have a clear or remove method to do this.
I have tried some ways to get around this such as the following:
if (!measureAccordion.getChildrenUnmodifiable().isEmpty()) {
ObservableList<javafx.scene.Node> accordionContent = measureAccordion.getChildrenUnmodifiable();
accordionContent.clear();
}
But this raised an UnsupportedOperationException.
If you check here accordion in javaFX , you will see that the accordion object has a method, getPanes(), which returns an ObservableList of TitledPane. The ObservableList has a lot of methods that you could use such as removeAll. You can see here the documentation for ObservableList.
Accordion is a control that can contain only TitledPane components. So if you want to modify content of Accordion then use Accordion#getPanes method.

Scene Builder button without text

I am trying to make a button with a graphic only, and Scene Builder won't let me clear the text in the button. It automatically reverts to "Button" for some reason. Is there a way to make this stop?
Seems to work fine with JavaFX Scene Builder 8.3.0:

JavaFX Tabpane selects 2 Tabs at the same time

I just started using JavaFX.
In my little Project I got two views. The first is filled with a tabpane, while the second one contains a button to add new tabs to the tabpane. That means I need to switch between the first and the second view to add new Tabs.
The tabpane has one standart-tab wich is unable to close.
My Problem: If I add more than one new tab to my tabpane all tabs are painted over each other.
I already triedto prevent it like this:
Init everything:
private ArrayList<Tab> allTabs = new ArrayList<Tab>();
Tab tab = new Tab();
allTabs.add(tab);
TabPane tp = new TabPane();
tp.getTabs().add(tab);
To set the selection I tried a few things:
tp.getSelectionModel().clearSelection();
tp.getSelectionModel().select(allTabs.size());
_________________________________________________________________
tp.getSelectionModel().clearSelection();
tp.getSelectionModel().select(tp.getTabs().size);
_________________________________________________________________
tp.getSelectionModel().selectLast();
_________________________________________________________________
tp.getSelectionModel().selectNext();
_________________________________________________________________
tp.getSelectionModel().clearAndSelect(tp.getTabs().size());;
I want to select the newest tab. This is already working but the old ones aren't deselected. The Problem disappears if I select tabs with a mouseclick.
I'm thankfull for any idea.
Is it possible that your using different FXMLLoaders?
I had an simular problem while i was using the normal FXMLLoader and a coustom FXMLLoader. Just try to use the same in both cases. This is the way how it works for me.
If it doesn't fix your problem some pictures and some more code-fragments would be helpful to solve your problem.
Greetings
I had similar problem, i just removed the line
tabpane.getSelectionModel().clearSelection();
No idea why it works.
Just keep :
tb.getSelectionModel().select(index or tab);
or
tb.getSelectionModel().clearAndSelect(index or tab);
PS : tp.getSelectionModel().clearAndSelect(tp.getTabs().size());
this, will do nothing, tp.getTabs().size() is out of bound, so it will

Disable TitledPane Expand

How I can disable TitledPane expand?
TitledPane pane = new TitledPane("Connections", content);
I can't find any information about this on Google.
You dont need to google, you can simply check javadoc or Ctrl+space will show you all methods for that class. To answer your question its
titledPane.setCollapsible(false);

Resources