diff --git a/src/main/java/ai/nets/samj/gui/LoadingButton.java b/src/main/java/ai/nets/samj/gui/LoadingButton.java index c6fc52d..e5429a4 100644 --- a/src/main/java/ai/nets/samj/gui/LoadingButton.java +++ b/src/main/java/ai/nets/samj/gui/LoadingButton.java @@ -104,7 +104,7 @@ public LoadingButton(String text, String filePath, String filename, double anima @Override public void mouseReleased(MouseEvent e) { if (isEnabled()) { - setPressed(!isSelected()); + showAnimation(!isSelected()); fireActionPerformed( new ActionEvent(LoadingButton.this, ActionEvent.ACTION_PERFORMED, @@ -163,13 +163,11 @@ private static File findJarFile(Class clazz) { } /** - * Set the button as pressed or not pressed, changing the image displayed - * @param isPressed - * whether the button is pressed or not + * Show the animation + * @param show + * whether the animation is shown or not */ - public void setPressed(boolean isPressed) { - super.setEnabled(!isPressed); - gifLabel.setVisible(isPressed); - this.setSelected(isPressed); + public void showAnimation(boolean show) { + gifLabel.setVisible(show); } } diff --git a/src/main/java/ai/nets/samj/gui/MainGUI.java b/src/main/java/ai/nets/samj/gui/MainGUI.java index 0181c44..de42794 100644 --- a/src/main/java/ai/nets/samj/gui/MainGUI.java +++ b/src/main/java/ai/nets/samj/gui/MainGUI.java @@ -217,6 +217,7 @@ private void loadModel() { } catch (IOException | RuntimeException | InterruptedException ex) { ex.printStackTrace(); } + this.go.showAnimation(false); }).start(); }