-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWebScraper.java
More file actions
27 lines (22 loc) · 931 Bytes
/
WebScraper.java
File metadata and controls
27 lines (22 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import javax.swing.*;
import java.awt.*;
public class WebScraper {
public static void main(String[] args) {
JFrame frame = new JFrame("Best Performing Stocks In May 2023");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(800, 500);
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
JTextArea textArea = new JTextArea();
JScrollPane scrollPane = new JScrollPane(textArea);
panel.add(scrollPane, BorderLayout.CENTER);
JButton scrapeButton = new JButton("Scrape");
scrapeButton.addActionListener(e -> {
StockScraper scraper = new BestPerformingStockScraper(textArea);
scraper.scrape();
});
panel.add(scrapeButton, BorderLayout.SOUTH);
frame.getContentPane().add(panel);
frame.setVisible(true);
}
}