Styling default JavaFX Dialogs

You can style your dialogs with your own css file, but for that you need to take into consideration that the dialog is in fact a new stage, with a new scene, and the root node is a DialogPane instance. So once you create some dialog instance: @Override public void start(Stage primaryStage) { Alert alert … Read more

How do I create an Android Spinner as a popup?

You can use an alert dialog AlertDialog.Builder b = new Builder(this); b.setTitle(“Example”); String[] types = {“By Zip”, “By Category”}; b.setItems(types, new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.dismiss(); switch(which){ case 0: onZipRequested(); break; case 1: onCategoryRequested(); break; } } }); b.show(); This will close the dialog when one of them is … Read more

Prompt Dialog in Windows Forms

You need to create your own Prompt dialog. You could perhaps create a class for this. public static class Prompt { public static string ShowDialog(string text, string caption) { Form prompt = new Form() { Width = 500, Height = 150, FormBorderStyle = FormBorderStyle.FixedDialog, Text = caption, StartPosition = FormStartPosition.CenterScreen }; Label textLabel = new … Read more

Disable click outside of angular material dialog area to close the dialog (With Angular Version 4.0+)

There are two ways to do it. In the method that opens the dialog, pass in the following configuration option disableClose as the second parameter in MatDialog#open() and set it to true: export class AppComponent { constructor(private dialog: MatDialog){} openDialog() { this.dialog.open(DialogComponent, { disableClose: true }); } } Alternatively, do it in the dialog component … Read more

Primefaces dialog + commandButton

You can try either of the following , I vote number one, it’s a cleaner design IMO Bring the <p:dialog/> outside of the general <h:form/> and put an <h:form/> inside it instead <p:dialog id=”dlg” header=”#{messages.chooseSkillLevel}” widgetVar=”dlg” modal=”true” dynamic=”true”> <h:form> <h:dataTable value=”#{editSkills.skillsAndLevels}” var=”skillslevel”> <h:column> #{skillslevel.skill.umiejetnosc} </h:column> <h:column> <p:selectOneMenu value=”#{skillslevel.level}” > <f:selectItems value=”#{editSkills.levels}” var=”level” itemLabel=”#{level.stopien}” itemValue=”#{level.id}” /> … Read more

How to change alert dialog header divider color android

You can actually change color of AlertDialog title by a very simple hack: public static void brandAlertDialog(AlertDialog dialog) { try { Resources resources = dialog.getContext().getResources(); int color = resources.getColor(…); // your color here int alertTitleId = resources.getIdentifier(“alertTitle”, “id”, “android”); TextView alertTitle = (TextView) dialog.getWindow().getDecorView().findViewById(alertTitleId); alertTitle.setTextColor(color); // change title text color int titleDividerId = resources.getIdentifier(“titleDivider”, “id”, … Read more