From 89c96085f7dc44075eb6ed3ae008691211ac1df1 Mon Sep 17 00:00:00 2001 From: Ralf Wisser Date: Fri, 26 Apr 2024 08:40:58 +0200 Subject: [PATCH] blinking --- src/main/gui/net/sf/jailer/ui/SessionForUI.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/main/gui/net/sf/jailer/ui/SessionForUI.java b/src/main/gui/net/sf/jailer/ui/SessionForUI.java index aae910249..211daa575 100644 --- a/src/main/gui/net/sf/jailer/ui/SessionForUI.java +++ b/src/main/gui/net/sf/jailer/ui/SessionForUI.java @@ -157,8 +157,18 @@ public void run() { session.connectionDialog.getContentPane().add(session.connectingPanel); session.connectionDialog.pack(); session.connectionDialog.setLocation(los.x + w.getWidth() / 2 - session.connectionDialog.getWidth() / 2, los.y + w.getHeight() / 2 - session.connectionDialog.getHeight() / 2); - session.connectionDialog.setVisible(true); + + Timer timer = new Timer(500, e -> { + session.connectingPanel.setBackground(Color.white.equals(session.connectingPanel.getBackground())? new Color(255, 230, 230) : Color.white); + }); + timer.setRepeats(true); + timer.setInitialDelay(timer.getDelay() * 3); + timer.start(); + + session.connectionDialog.setVisible(true); session.connectionDialog.dispose(); + timer.stop(); + Throwable throwable = exception.get(); if (throwable != null) { if (throwable instanceof SQLException) { @@ -201,11 +211,10 @@ private SessionForUI(DataSource dataSource, DBMS dbms, Integer isolationLevel, b connectingPanel.setBackground(java.awt.Color.white); connectingPanel.setBorder(BorderFactory.createLineBorder(Color.DARK_GRAY)); - jLabel1.setForeground(java.awt.Color.red); - jLabel1.setText("connecting..."); +// jLabel1.setForeground(java.awt.Color.red); + jLabel1.setText("Connecting..."); jLabel1.setFont(jLabel1.getFont().deriveFont((float) (jLabel1.getFont().getSize() * 1.4))); connectingPanel.add(jLabel1); - cancelConnectingButton.setText("Cancel"); cancelConnectingButton.setIcon(UIUtil.scaleIcon(cancelConnectingButton, cancelIcon)); cancelConnectingButton.addActionListener(new java.awt.event.ActionListener() {