Compare commits
11 Commits
master
...
debug-logo
Author | SHA1 | Date | |
---|---|---|---|
|
de4afed4ba | ||
|
968324cfc2 | ||
|
ffef137a6b | ||
|
0d3aa4e536 | ||
|
f9dccd7a7f | ||
|
8a2c15f5bb | ||
|
c9487e2ef8 | ||
|
bb6c7cf4c5 | ||
c541e43d35 | |||
68b4873cfe | |||
2e15fc5835 |
6
.vscode/settings.json
vendored
6
.vscode/settings.json
vendored
@ -5,5 +5,9 @@
|
|||||||
"lib/**/*.jar"
|
"lib/**/*.jar"
|
||||||
],
|
],
|
||||||
"liveshare.shareExternalFiles": false,
|
"liveshare.shareExternalFiles": false,
|
||||||
"liveshare.allowGuestDebugControl": true
|
"liveshare.allowGuestDebugControl": true,
|
||||||
|
"cSpell.words": [
|
||||||
|
"Jlogo",
|
||||||
|
"Jname"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
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.
@ -15,6 +15,7 @@ public class ManagerGui extends JFrame {
|
|||||||
ImageIcon logo;
|
ImageIcon logo;
|
||||||
String buttonNameQuit = "Quit";
|
String buttonNameQuit = "Quit";
|
||||||
String buttonNameBill = "Show bill";
|
String buttonNameBill = "Show bill";
|
||||||
|
double ratio = 207.0/163.0;
|
||||||
|
|
||||||
|
|
||||||
Vector<Row> prestations = new Vector<>();
|
Vector<Row> prestations = new Vector<>();
|
||||||
@ -37,6 +38,10 @@ public class ManagerGui extends JFrame {
|
|||||||
Jlogo = new JLabel(logo);
|
Jlogo = new JLabel(logo);
|
||||||
Jname = new JLabel(name);
|
Jname = new JLabel(name);
|
||||||
this.add(Jname);
|
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);
|
this.add(Jlogo);
|
||||||
|
|
||||||
|
|
||||||
@ -86,6 +91,16 @@ public class ManagerGui extends JFrame {
|
|||||||
this.add(buttonQuit);
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user