Move ButtonType JavaFX in a Dialog - button

I'm working in a Dialog in JavaFX , the user have to insert a keyword in a textfield , then have to press a buttontype that I have created like this:
ButtonType find= new ButtonType("Find");
Here my problem, the button always stays in the lower right corner of the dialog, so , I want to put where I want. In the case was a button I would solve with a Pane and SetLayoutX/SetLayoutY, but I don't know how to do with Buttontype.

Related

Scenebuilder Button ID

If I create a button in scenebuilder and want to use this button in my javacode, what is the ID of this button?
I've tried with writing a fx:id, lets say button1.
when trying Button button1 = new Button(); I cant access this ID, is there any possible way to do this?

open a tab pane with enter key in bootstrap

Once click tab key at the active tab pane's last text box, I can see next tab pane tab pane's tab header getting highlight , then once I click EnterKey I cannot open that tab pane,
whats wrong here , how to open tab pane with enter key in bootstrap
Check if the focus is on the next tab pane, and also see if the event EnterKey has something to do with the focus next tab before it executes the codes.

Custom popup in JavaFX

Is there any way to create a custom PopUp in JavaFX? I can't use tooltip, since I would like it to appear on double click, also I would like a different style than the standard tooltip.
My demands for the popup are:
1. If the user double click, show the popup
2. if the user clicks outside the popup, hide it
See this guide on all the different types of popups.
Use Popup.
Popup popup = new Popup();
// add content (you can add as many nodes as you want)
popup.getContent().add(new Label("Hello Popup!"));
// show (move this to the double-click listener)
popup.show(primaryStage);
// hide (move this to the click listener)
popup.hide();

QML: redraw TableView when context menu shown

I show context menu when user right clicks on row at TableView and select clicked item:
downloadContextMenu.popup()
tableView.selection.clear()
tableView.selection.select(row)
but TableView show selection only if I will move mouse to something else (i.e. button) after it. So, how to update TableView in this case?
downloadContextMenu is Menu
P.S. If I will do it by this:
tableView.selection.clear()
tableView.selection.select(row)
downloadContextMenu.popup()
I will have the same problem, but after next opening of context menu (open menu, then click outside to close it, then open again)

Application Crash problem on second time click on Menu Arrow of QToolButton

In my APPlication I have to show filter option (as filter option in xls)in Qtable widget for this
I have used tool Button( with property "QToolButton::MenuButtonPopup") to display Menu List and
Upon First Click upon Menu arrow it should show Menu list and selection of any of the Menu it should show only row having the text.
This functionality works fine.
But if Nothing is selected from Menu list and user has clicked Menu arrow second time then list should be hidden but in my case
application crashes giving error:
ASSERT failure in QList::operator[]: "index out of range", file ........\Qt\2010.04\qt\include/QtCore/../../src/corelib/tools/qlist.h, line 447
I have written below code:
QToolButton *lToolButton = new QToolButton();
lToolButton->setPopupMode(QToolButton::MenuButtonPopup);
lToolButton->setAutoRaise(true);
lToolButton->setText("Filter");
QMenu *lMenu = new QMenu();
QAction *lAction = new QAction("All",this);
lMenu->addAction(lAction);
lToolButton->setMenu(lMenu);
Please let me know what is wrong in my coding.
Can you run your app in the debugger and find at what line in your code (not in Qt's code) the error is happening? The problem should then because more obvious.

Resources