diff --git a/src/webcrawler/ApplicationRunner.java b/src/webcrawler/ApplicationRunner.java index e2a4260..6ff7231 100644 --- a/src/webcrawler/ApplicationRunner.java +++ b/src/webcrawler/ApplicationRunner.java @@ -1,7 +1,9 @@ package webcrawler; +import javax.swing.*; + public class ApplicationRunner { public static void main(String[] args) { - new WebCrawler(); + SwingUtilities.invokeLater(WebCrawler::new); } } diff --git a/src/webcrawler/WebCrawler.java b/src/webcrawler/WebCrawler.java index 737f85a..64e092d 100644 --- a/src/webcrawler/WebCrawler.java +++ b/src/webcrawler/WebCrawler.java @@ -1,12 +1,18 @@ package webcrawler; import javax.swing.*; +import java.awt.*; public class WebCrawler extends JFrame { public WebCrawler() { - setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - setSize(300, 300); - setVisible(true); - setLayout(null); + super.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + super.setPreferredSize(new Dimension(512, 512)); + super.setTitle("Web Crawler"); + + // Create components and add them to this JFrame. + + super.setVisible(true); + super.pack(); + super.setLocationRelativeTo(null); } } \ No newline at end of file