Fixed Toaster - always on top

This commit is contained in:
Robert Vokac 2024-01-14 16:55:39 +00:00
parent 0453f50143
commit c636853666
No known key found for this signature in database
GPG Key ID: 693D30BEE3329055
2 changed files with 8 additions and 3 deletions

View File

@ -180,7 +180,7 @@ public class TimeCalc {
s = s.replace(",","");
int percentInt = (int)(percent * 100);
if(!alreadyShownPercents.contains((int)(percent*100)) || true) {
if(!alreadyShownPercents.contains((int)(percent*100))) {
alreadyShownPercents.add((int)(percent*100));
Toaster toasterManager = new Toaster();
Font font = new Font("sans", Font.PLAIN, 32);

View File

@ -29,6 +29,8 @@ package rvc.timecalc;
*/
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
import javax.swing.border.*;
@ -213,8 +215,8 @@ public class Toaster
* Animate vertically the toaster. The toaster could be moved from bottom
* to upper or to upper to bottom
* @param posx
* @param fromy
* @param toy
* @param fromY
* @param toY
* @throws InterruptedException
*/
protected void animateVertically( int posx, int fromY, int toY ) throws InterruptedException
@ -330,6 +332,9 @@ public class Toaster
singleToaster.iconLabel.setIcon( icon );
}
singleToaster.message.setText( msg );
singleToaster.toFront( );
singleToaster.setAlwaysOnTop(true);
singleToaster.animate();
}