From 198c44391d09825fcf3ae947b7816eb593c36c6a Mon Sep 17 00:00:00 2001 From: fdai6040 Date: Fri, 3 Feb 2023 12:00:48 +0100 Subject: [PATCH] New task "Datum" added --- src/main/java/src/TasksFrame.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/main/java/src/TasksFrame.java b/src/main/java/src/TasksFrame.java index fddb709..67b7952 100644 --- a/src/main/java/src/TasksFrame.java +++ b/src/main/java/src/TasksFrame.java @@ -1,6 +1,7 @@ package src; import javax.swing.*; +import javax.swing.border.Border; import javax.swing.border.EmptyBorder; import java.awt.*; import java.awt.event.ActionEvent; @@ -66,6 +67,8 @@ public class TasksFrame extends JFrame { setupHelloWorld(); + setupDate(); + setupSum(); setupDiff(); @@ -91,6 +94,25 @@ public class TasksFrame extends JFrame { setupBmi(); + + + } + + private void setupDate() { + + JPanel jPanel = setupPanel("Datum"); + + String dateStr = String.format("%ta, %1$te. %1$tb %1$tY - %1$tT", System.currentTimeMillis()); + JLabel label = new JLabel(dateStr); + label.setVisible(true); + label.setBounds(10, 45, 160, 50); + Border border = BorderFactory.createLineBorder(Color.BLUE, 3); + label.setBorder(border); + label.setForeground(Color.BLACK); + + + jPanel.add(label); + } private void setupBmi() {