mirror of
https://github.com/robertvokac/time-calc.git
synced 2025-03-25 07:27:49 +01:00
Added new improvements
This commit is contained in:
parent
e82ca52253
commit
b98ae4ef97
@ -83,6 +83,7 @@ public class TimeCalcWindow {
|
|||||||
|
|
||||||
JFrame window = new JFrame();
|
JFrame window = new JFrame();
|
||||||
|
|
||||||
|
JButton focusButton = new JButton("F");
|
||||||
JButton commandButton = new JButton("Command");
|
JButton commandButton = new JButton("Command");
|
||||||
JButton weatherButton = new JButton("Weather");
|
JButton weatherButton = new JButton("Weather");
|
||||||
JButton jokeButton = new JButton("Joke");
|
JButton jokeButton = new JButton("Joke");
|
||||||
@ -91,6 +92,7 @@ public class TimeCalcWindow {
|
|||||||
|
|
||||||
//window.add(weatherButton);
|
//window.add(weatherButton);
|
||||||
window.add(commandButton);
|
window.add(commandButton);
|
||||||
|
window.add(focusButton);
|
||||||
|
|
||||||
window.add(jokeButton);
|
window.add(jokeButton);
|
||||||
window.add(restartButton);
|
window.add(restartButton);
|
||||||
@ -165,11 +167,14 @@ public class TimeCalcWindow {
|
|||||||
weatherButton
|
weatherButton
|
||||||
.setBounds(20, text.getY() + text.getHeight() + 10, 100, 30);
|
.setBounds(20, text.getY() + text.getHeight() + 10, 100, 30);
|
||||||
commandButton.setBounds(20, text.getY() + text.getHeight() + 10, 100, 30);
|
commandButton.setBounds(20, text.getY() + text.getHeight() + 10, 100, 30);
|
||||||
|
|
||||||
jokeButton.setBounds(140, text.getY() + text.getHeight() + 10, 100, 30);
|
jokeButton.setBounds(140, text.getY() + text.getHeight() + 10, 100, 30);
|
||||||
restartButton
|
restartButton
|
||||||
.setBounds(280, text.getY() + text.getHeight() + 10, 100, 30);
|
.setBounds(280, text.getY() + text.getHeight() + 10, 100, 30);
|
||||||
exitButton.setBounds(390, text.getY() + text.getHeight() + 10, 100, 30);
|
exitButton.setBounds(390, text.getY() + text.getHeight() + 10, 100, 30);
|
||||||
|
|
||||||
|
focusButton.setBounds(exitButton.getX() + 10 + exitButton.getWidth() + 20, exitButton.getY(), 40, 30);
|
||||||
|
|
||||||
window.setSize(520 + 20 + 100, 580);
|
window.setSize(520 + 20 + 100, 580);
|
||||||
window.setLayout(null);
|
window.setLayout(null);
|
||||||
window.setVisible(true);
|
window.setVisible(true);
|
||||||
@ -216,8 +221,9 @@ public class TimeCalcWindow {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
focusButton.addActionListener(e -> {
|
||||||
|
window.requestFocus();
|
||||||
|
});
|
||||||
jokeButton.addActionListener(e -> {
|
jokeButton.addActionListener(e -> {
|
||||||
for (int i = 1; i <= 1; i++) {
|
for (int i = 1; i <= 1; i++) {
|
||||||
Jokes.showRandom();
|
Jokes.showRandom();
|
||||||
@ -305,6 +311,8 @@ public class TimeCalcWindow {
|
|||||||
batteryForWeek.setVisible(!Utils.everythingHidden.get());
|
batteryForWeek.setVisible(!Utils.everythingHidden.get());
|
||||||
batteryForMonth.setVisible(!Utils.everythingHidden.get());
|
batteryForMonth.setVisible(!Utils.everythingHidden.get());
|
||||||
jokeButton.setVisible(!TimeCalcConf.getInstance().isJokeVisible()? false : !Utils.everythingHidden.get());
|
jokeButton.setVisible(!TimeCalcConf.getInstance().isJokeVisible()? false : !Utils.everythingHidden.get());
|
||||||
|
focusButton.setVisible(!Utils.everythingHidden.get());
|
||||||
|
|
||||||
commandButton.setVisible(!Utils.everythingHidden.get());
|
commandButton.setVisible(!Utils.everythingHidden.get());
|
||||||
restartButton.setVisible(!Utils.everythingHidden.get());
|
restartButton.setVisible(!Utils.everythingHidden.get());
|
||||||
exitButton.setVisible(!Utils.everythingHidden.get());
|
exitButton.setVisible(!Utils.everythingHidden.get());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user