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 8096081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:20:34+00:00 2026-06-05T21:20:34+00:00

I have been using this code to implement a Popup JDialog of sorts, like

  • 0

I have been using this code to implement a Popup JDialog of sorts, like what you see when your anti-virus is scanning your system or updates itself:

import java.awt.*;
import javax.swing.JDialog;
import javax.swing.JLabel;

public class PopupDialog extends JDialog {

    public PopupDialog() throws HeadlessException {
        createUI();
    }

    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                PopupDialog popupDialog = new PopupDialog();
                popupDialog.setVisible(true);
            }
        });
    }

    private void createUI() {
        setTitle("Popup Dialog");
        setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);

        addComponentsToFrame();

        //This call will give screens viable area, which takes into account the taskbar, which could be at the bottom, top,left or right of the screen.
        Rectangle maxBounds = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();

        //get screen size
        int sWidth = maxBounds.width, sHeight = maxBounds.height;

        setSize(275, 225);//set frame size
        Dimension appDim = getSize();
        //get app size
        int aWidth = appDim.width, aHeight = appDim.height;

        //set location like a tooltip would be except its a custom dialog like an AV
        setLocation(sWidth - aWidth, (sHeight - aHeight));
    }

    private void addComponentsToFrame() {
        JLabel label = new JLabel("Popup Dialog");
        getContentPane().add(label, BorderLayout.CENTER);
    }
}

But my question is: is there any class or package in java that will do this for me? and if not how would I go about allowing the JDialog to slide up from the taskbar (or offscreen)? or somehow become visible in a slow manner like a ToolTip Popup would from the system tray. Thanks.

EDIT The reason i want to use a JDialog or Frame is because i want to be able to fully skin the Popup window, using setUndecorated(true); and adding custom exit icons, backgrounds etc

  • 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-05T21:20:35+00:00Added an answer on June 5, 2026 at 9:20 pm

    You mean like the examples here: http://docs.oracle.com/javase/tutorial/uiswing/misc/systemtray.html ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been using this code, but have been running into some memory issues:
I have been using this code with great success to pull out the first
I have been using this link to learn about multiprocessing, but I'm stuck on
I have been using this copy method for quite a while, in lots of
I have been using this as a reference, but not able to accomplish exactly
I have been using this so far system 'strings binary-file.dmp | grep search_string' Is
I have been using this excellent decorator for memoization, which I found on the
I have been using an API to do some work. This is how I
I have been using Twitter's Bootstrap Tooltip plugin . This works perfectly fine except
I have been trying to implement hash-tables using uthash.h, following the (excellent) documentation I

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.