Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package swing_local_date;
- import java.awt.Font;
- import java.time.LocalDate;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.SwingConstants;
- public class main {
- public static void main(String[] args) {
- LocalDate date = LocalDate.now();
- JFrame frame = new JFrame("Show LocalDate");
- JLabel label = new JLabel();
- label.setHorizontalAlignment(SwingConstants.CENTER);
- label.setFont(new Font("Arial", Font.BOLD, 25));
- label.setText(date.toString());
- frame.setSize(300, 300);
- frame.setLocationRelativeTo(null);
- frame.add(label);
- frame.setVisible(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement