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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:53:39+00:00 2026-06-08T19:53:39+00:00

I have a JPanel window with a few things drawn on it. I am

  • 0

I have a JPanel window with a few things drawn on it. I am trying to figure out how I can flash the screen, like one simple flash, to get a users attention? I found a previous question on this but it did not work for what I am trying to do. I have a continuous loop that updates the screen based on a few variables. I would just like the screen to flash at a certain point and then go back to normal.

Thanks!

  • 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-08T19:53:40+00:00Added an answer on June 8, 2026 at 7:53 pm

    You can use Trident to interpolate various properties in your class. Here is a demo that animates panel’s background:

    import java.awt.Color;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.SwingUtilities;
    
    import org.pushingpixels.trident.Timeline;
    import org.pushingpixels.trident.Timeline.RepeatBehavior;
    
    public class TestPanel {
        private static void createAndShowGUI() {
            JFrame frame = new JFrame();
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JPanel panel = new JPanel();
            panel.add(new JLabel("Some text"));
    
            frame.add(panel);
            frame.pack();
            frame.setVisible(true);
    
            final Timeline timeline = new Timeline(panel);
            timeline.addPropertyToInterpolate("background", panel.getBackground(),
                    Color.red);
            timeline.setDuration(1000);
    
            timeline.playLoop(5, RepeatBehavior.REVERSE);
        }
    
        public static void main(String[] args) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
                }
            });
        }
    }
    

    EDIT: comments to auto hide a popup

    You can use timer to hide a popup, for example:

    import javax.swing.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    
    public class TempPopup {
    
        public static void main(String[] args) {
    
            JOptionPane pane = new JOptionPane("Message",
                    JOptionPane.INFORMATION_MESSAGE);
            final JDialog dialog = pane.createDialog(null, "Title");
    
            Timer timer = new Timer(2000, new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    dialog.setVisible(false);
                    dialog.dispose();
                }
            });
            timer.setRepeats(false);
            timer.start();
            dialog.setVisible(true);
            dialog.dispose();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an JPanel populated with several opaque custom components. Now I would like
I have a JPanel, which I would like to detect the following events (1)
I have a JPanel that encapsulates two JPanels, one on top of the other.
I have 2 windows one window shown the JTable Model data, when double click
http://pastebin.com/VaaTRsuf I would like to have the JList and JTextArea resize with the window,
I have this simple application in which a command like RECT 10 20 100
I have to create a Matlab figure window with custom maximize/minimize and close buttons.
I have a Main app window (JFrame) with JPanel. On JPanel I have some
I want to have transparent panels in my GUI (if like Windows 7 window
I have got a window that looks like window1 and I would like it

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.