Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8794261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:13:40+00:00 2026-06-13T23:13:40+00:00

How do I show a popup window using either PopupWindow or Popup from JavaFX

  • 0

How do I show a popup window using either PopupWindow or Popup from JavaFX 2.0? I can’t find any tutorials or samples.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T23:13:41+00:00Added an answer on June 13, 2026 at 11:13 pm
    public class test extends Application{
    
        Stage primaryStage;
    
        @Override
        public void start(final Stage stage) throws Exception {
    
            primaryStage = stage;
    
            Button showPopUp = new Button("Pop Up");
            final TextField name = new TextField();
    
            VBox vBox = new VBox();
            vBox.getChildren().add(name);
            vBox.getChildren().add(showPopUp);
    
    
            final Label hello = new Label();
            final TextField name2 = new TextField();
            Button ok = new Button("ok");
            Button cencel = new Button("cancel");
    
            VBox popUpVBox = new VBox();
            popUpVBox.getChildren().add(hello);
            popUpVBox.getChildren().add(name2);
            popUpVBox.getChildren().add(ok);
            popUpVBox.getChildren().add(cencel);
    
            final Popup popup = new Popup();
            popup.setAutoFix(false);
            popup.setHideOnEscape(true);
            popup.getContent().addAll(popUpVBox);
            popup.setX(250);
            popup.setY(175);
    
            ok.setOnAction(new EventHandler<ActionEvent>() {
    
                @Override
                public void handle(ActionEvent t) {
                     name.setText(name2.getText());
                }
            });
    
            cencel.setOnAction(new EventHandler<ActionEvent>() {
    
                @Override
                public void handle(ActionEvent t) {
                    popup.hide();
                }
            });
    
    
            showPopUp.setOnAction(new EventHandler<ActionEvent>() {
    
                @Override
                public void handle(ActionEvent t) {
                     if (popup.isShowing()) {
                        popup.hide();
                    } else {
                         hello.setText("hello.."+name.getText());
                        popup.show(stage);
                    }
                }
            });
    
            Scene scene = new Scene(vBox);
    
            primaryStage.setScene(scene);
            primaryStage.setWidth(200);
            primaryStage.setHeight(200);
            primaryStage.show();
        }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use fancybox to show a popup window from another url, using iframe. Here
I am using simple modal window to show dynamic content(table) on modal window popup.
How to show annotation present in an entity in popup window by using html
Am using the following code to show map in a popup window. But map
I'm using a PopupWindow to show some subcategories when clicking on a ListView item.
I want to show Popup window contain YouTube video. My question is how to
I need to show a popup window before a query execution, show the time
I have to show a popup window on click of home screen button. I
I am creating a new window popup window using PopupWindows.PaymentsSummary paymentsSummary = new PopupWindows.PaymentsSummary
Im trying to create a browser popup window with some text, rather than using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.