Author SHA1 Message Date
Klagarge 60718d7c35 small polish 2022-05-19 09:35:06 +02:00
21 changed files with 4 additions and 16 deletions
+3 -1
View File
@@ -7,7 +7,9 @@
"liveshare.shareExternalFiles": false,
"liveshare.allowGuestDebugControl": true,
"cSpell.words": [
"Jframe",
"Jlogo",
"Jname"
"Jname",
"Mudry"
]
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -15
View File
@@ -15,7 +15,6 @@ public class ManagerGui extends JFrame {
ImageIcon logo;
String buttonNameQuit = "Quit";
String buttonNameBill = "Show bill";
double ratio = 207.0/163.0;
Vector<Row> prestations = new Vector<>();
@@ -38,10 +37,6 @@ public class ManagerGui extends JFrame {
Jlogo = new JLabel(logo);
Jname = new JLabel(name);
this.add(Jname);
//logo = new ImageIcon(new ImageIcon(logoFilePath).getImage().getScaledInstance(207, 163, Image.SCALE_DEFAULT));
//Jlogo = new JLabel(logo);
Jlogo = resize(Jname, logoFilePath);
this.add(Jlogo);
@@ -84,6 +79,7 @@ public class ManagerGui extends JFrame {
@Override
public void actionPerformed(ActionEvent e){
Jf.dispose();
System.exit(0);
};
});
@@ -91,16 +87,6 @@ public class ManagerGui extends JFrame {
this.add(buttonQuit);
}
private JLabel resize(JLabel Jlogo, String logoFilePath){
//TODO put in listener for resize when frame is resize.
int width = (int)Jlogo.getSize().getWidth();
int height = (int)Jlogo.getSize().getHeight();
height = height > 0 ? height:65;
System.out.println(width + "x"+ height);
ImageIcon logo = new ImageIcon(new ImageIcon(logoFilePath).getImage().getScaledInstance((int) (height*ratio), height, Image.SCALE_DEFAULT));
return new JLabel(logo);
}
}