本文整理汇总了Java中javafx.scene.control.Alert.AlertType.WARNING属性的典型用法代码示例。如果您正苦于以下问题:Java AlertType.WARNING属性的具体用法?Java AlertType.WARNING怎么用?Java AlertType.WARNING使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javafx.scene.control.Alert.AlertType
的用法示例。
在下文中一共展示了AlertType.WARNING属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: editClicked
public void editClicked(){
if(lstudname.getText().equals(""))
{
// Nothing selected.
Alert alert = new Alert(AlertType.WARNING);
alert.setTitle("No Selection");
alert.setHeaderText("No Lecturer Selected");
alert.setContentText("Please select a Lecturer in the list.");
alert.showAndWait();
}
else
{
try {
new EditLec().start(new Stage());
EditLec.txtid.setText(lstudname.getText());
} catch (Exception e) {
ErrorMessage.display("Launch Error", e.getMessage()+" Application Launch Error");
e.printStackTrace();
}
}
}
示例2: editClicked
public void editClicked(){
if(lstudname.getText().equals(""))
{
// Nothing selected.
Alert alert = new Alert(AlertType.WARNING);
alert.setTitle("No Selection");
alert.setHeaderText("No Lecturer Selected");
alert.setContentText("Please select a Lecturer in the list.");
alert.showAndWait();
}
else
{
try {
new EditVisitor().start(new Stage());
EditVisitor.txtid.setText(lstudname.getText());
} catch (Exception e) {
ErrorMessage.display("Launch Error", e.getMessage()+" Application Launch Error");
e.printStackTrace();
}
}
}
示例3: setPressbEdit
public void setPressbEdit(){
if(txtname.getText().equals("") || txtlevel.getText().equals(""))
{
// Nothing selected.
Alert alert = new Alert(AlertType.WARNING);
alert.setTitle("No Selection");
alert.setHeaderText("No Person Selected");
alert.setContentText("Please select a person in the table.");
alert.showAndWait();
}
else
{
EditingClass ec= new EditingClass();
ec.setToEdit();
}
}
示例4: editClicked
public void editClicked(){
if(lstudname.getText().equals(""))
{
// Nothing selected.
Alert alert = new Alert(AlertType.WARNING);
alert.setTitle("No Selection");
alert.setHeaderText("No Person Selected");
alert.setContentText("Please select a Staff in the list.");
alert.showAndWait();
}
else
{
try {
new EditOffice().start(new Stage());
EditOffice.txtid.setText(lstudname.getText());
} catch (Exception e) {
ErrorMessage.display("Launch Error", e.getMessage()+" Application Launch Error");
e.printStackTrace();
}
}
}
示例5: handleEditEntry
@FXML
private void handleEditEntry() throws Exception {
Entry selectedEntry = entryTable.getSelectionModel().getSelectedItem();
if (selectedEntry != null) {
boolean okClicked = mainApp.showAppEditDialog(selectedEntry);
if (okClicked) {
// removed description field
}
}
else {
Alert alert = new Alert(AlertType.WARNING);
alert.initOwner(mainApp.getPrimaryStage());
alert.setTitle("No Selection");
alert.setHeaderText("No Entry Selected");
alert.setContentText("Please select an entry in the table.");
alert.showAndWait();
}
}
示例6: handleDeleteEntry
@FXML
private void handleDeleteEntry() {
int selectedIndex = entryTable.getSelectionModel().getSelectedIndex();
if (selectedIndex >= 0) {
entryTable.getItems().remove(selectedIndex);
}
else {
Alert alert = new Alert(AlertType.WARNING);
alert.initOwner(mainApp.getPrimaryStage());
alert.setTitle("No Selection");
alert.setHeaderText("No Entry Selected");
alert.setContentText("Please select an entry in the table");
alert.showAndWait();
}
}
示例7: displayAlert
/**
* Create and display an alert to the user.
*
* @param message
* string to display to user.
*/
private void displayAlert(String message) {
Alert infoAlert = new Alert(AlertType.WARNING);
infoAlert.setTitle(null);
infoAlert.setHeaderText(null);
infoAlert.setContentText(message);
infoAlert.showAndWait();
}
示例8: warning
public static void warning(String title,String header,String body){
Alert alert = new Alert(AlertType.WARNING);
alert.setTitle(title);
alert.setHeaderText(header);
alert.setContentText(body);
alert.showAndWait();
}
示例9: warningAlert
public static Alert warningAlert(String header, String message, Throwable t) {
Alert alert = new Alert(AlertType.WARNING);
alert.setTitle("Warning");
alert.setHeaderText(header);
alert.setContentText(message);
if(t != null)
alert.getDialogPane().setExpandableContent(createExpandableContent(t));
return alert;
}
示例10: showWarning
public static Alert showWarning(String message) {
Alert alert = new Alert(AlertType.WARNING);
alert.setTitle("Warning");
alert.setHeaderText(null);
alert.setContentText(message);
return alert;
}
示例11: getFont
public static Font getFont(String name) {
if (!Font.getFamilies().contains(name)) {
Alert a = new Alert(AlertType.WARNING);
a.setContentText("Could not find font " + name + ". Defaulting to system font.");
a.show();
}
return Font.font(name);
}
示例12: showWarningDialogue
public static void showWarningDialogue(String title, String message)
{
Alert alert = new Alert(AlertType.WARNING);
alert.setTitle(title);
alert.setHeaderText(null);
alert.setContentText(message);
alert.showAndWait();
}
示例13: deleteClicked
public void deleteClicked()
{
if(lstudname.getText().equals(""))
{
// Nothing selected.
Alert alert = new Alert(AlertType.WARNING);
alert.setTitle("No Selection");
alert.setHeaderText("No Lecturer Selected");
alert.setContentText("Please select a Lecturer in the list.");
alert.showAndWait();
}
else
{
boolean result = Confirmation.display("Delete Record", " Are you sure you want to delete this \n Lecturer? ");
if(result)
{
ObservableList<Reports> selectedProd, allProd;
allProd= tableView.getItems();
selectedProd = tableView.getSelectionModel().getSelectedItems();
//selectedProd.forEach(allProd:: remove);
//the delete query is now complete ------------------>
String query = "DELETE FROM Lecturers where s_id = '" + lstudname.getText() + "'";
//connect to database
DBConnect.connect();
try {
DBConnect.stmt.execute(query);
selectedProd.forEach(allProd:: remove);
SuccessMessage.display("Success", "Lecturer has been deleted successfully");
DBConnect.closeConnection();
} catch (Exception ea) {
ErrorMessage.display("Launching Error", ea.getMessage()+" Error has occurred. Consult administrator");
}
}
}
}
示例14: deleteClicked
public void deleteClicked()
{
if(lstudname.getText().equals(""))
{
// Nothing selected.
Alert alert = new Alert(AlertType.WARNING);
alert.setTitle("No Selection");
alert.setHeaderText("No Lecturer Selected");
alert.setContentText("Please select a Visitor in the list.");
alert.showAndWait();
}
else
{
boolean result = Confirmation.display("Delete Record", " Are you sure you want to delete this \nVisitor? ");
if(result)
{
ObservableList<Reports> selectedProd, allProd;
allProd= tableView.getItems();
selectedProd = tableView.getSelectionModel().getSelectedItems();
//selectedProd.forEach(allProd:: remove);
//the delete query is now complete ------------------>
String query = "DELETE FROM visitors where s_id = '" + lstudname.getText() + "'";
//connect to database
DBConnect.connect();
try {
DBConnect.stmt.execute(query);
selectedProd.forEach(allProd:: remove);
SuccessMessage.display("Success", "Lecturer has been deleted successfully");
DBConnect.closeConnection();
} catch (Exception ea) {
ErrorMessage.display("Launching Error", ea.getMessage()+" Error has occurred. Consult administrator");
}
}
}
}
示例15: deleteClicked
public void deleteClicked()
{
if(txtname.getText().equals("") || txtlevel.getText().equals(""))
{
// Nothing selected.
Alert alert = new Alert(AlertType.WARNING);
alert.setTitle("No Selection");
alert.setHeaderText("No Person Selected");
alert.setContentText("Please select a person in the table.");
alert.showAndWait();
}
else
{
boolean result = Confirmation.display("Delete Record", " Are you sure you want to delete this \n user? ");
if(result)
{
ObservableList<UserCreation> selectedProd, allProd;
allProd= table.getItems();
selectedProd = table.getSelectionModel().getSelectedItems();
//selectedProd.forEach(allProd:: remove);
//the delete query is now complete ------------------>
String query = "DELETE FROM login where username='" + txtname.getText() + "'";
//connect to database
DBConnect.connect();
try {
DBConnect.stmt.execute(query);
selectedProd.forEach(allProd:: remove);
SuccessMessage.display("Success", "User has been deleted successfully");
DBConnect.closeConnection();
} catch (Exception ea) {
ErrorMessage.display("Launching Error", ea.getMessage()+" Error has occurred. Consult administrator");
}
}
}
}