From 20d7f48883b9b0ea51250acd505c75d7081251dc Mon Sep 17 00:00:00 2001 From: Hammy Date: Mon, 19 Jul 2021 03:03:44 +0100 Subject: [PATCH] Call new ClipboardView class & set Windows Look and Feel --- src/main/java/me/goudham/Main.java | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/src/main/java/me/goudham/Main.java b/src/main/java/me/goudham/Main.java index f067f45..a4f2ae3 100644 --- a/src/main/java/me/goudham/Main.java +++ b/src/main/java/me/goudham/Main.java @@ -2,26 +2,17 @@ package me.goudham; import me.goudham.view.ClipboardView; -import javax.swing.JFrame; -import java.awt.Color; -import java.awt.Dimension; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; /** * Hello world! * */ public class Main { - public static void main( String[] args ) { - JFrame jFrame = new JFrame(); - jFrame.setTitle("My Clipboard History"); - jFrame.setVisible(true); - jFrame.setContentPane(new ClipboardView().getClipboard()); - jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - jFrame.getContentPane().setBackground(new Color(1, 3, 25)); - jFrame.setPreferredSize(new Dimension(1000, 680)); - jFrame.setMaximumSize(new Dimension(1000, 680)); - jFrame.setResizable(false); - jFrame.pack(); - jFrame.setLocationRelativeTo(null); + public static void main(String[] args) throws UnsupportedLookAndFeelException, ClassNotFoundException, InstantiationException, IllegalAccessException { + UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + SwingUtilities.invokeLater(() -> new ClipboardView().createAndShowGUI()); } }