本文整理匯總了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");
}
}
}
}