Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Futbol;
- import java.awt.EventQueue;
- import javax.swing.JFrame;
- import java.awt.GridBagLayout;
- import java.awt.BorderLayout;
- import javax.swing.JPanel;
- import javax.swing.JLabel;
- import java.awt.GridBagConstraints;
- import javax.swing.JComboBox;
- import java.awt.Insets;
- import java.net.MalformedURLException;
- import java.net.URL;
- import java.util.ArrayList;
- import javax.swing.JSlider;
- import javax.swing.JTable;
- import javax.swing.JScrollPane;
- public class Principal {
- private JFrame frame;
- private JTable resultsTable;
- private JSlider weekSlider;
- private JComboBox<String> leagueComboBox;
- private JComboBox<String> countryComboBox;
- /**
- * Launch the application.
- */
- public static void main(String[] args) {
- EventQueue.invokeLater(new Runnable() {
- public void run() {
- try {
- Principal window = new Principal();
- window.frame.setVisible(true);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- });
- }
- /**
- * Create the application.
- */
- public Principal() {
- initialize();
- }
- /**
- * Initialize the contents of the frame.
- */
- private void initialize() {
- frame = new JFrame();
- frame.setBounds(100, 100, 540, 358);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.getContentPane().setLayout(new BorderLayout(0, 0));
- JPanel panel = new JPanel();
- frame.getContentPane().add(panel, BorderLayout.CENTER);
- GridBagLayout gbl_panel = new GridBagLayout();
- gbl_panel.columnWidths = new int[]{72, 0, 0};
- gbl_panel.rowHeights = new int[]{0, 0, 0, 0, 0};
- gbl_panel.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
- gbl_panel.rowWeights = new double[]{0.0, 0.0, 0.0, 1.0, Double.MIN_VALUE};
- panel.setLayout(gbl_panel);
- JLabel lblCountry = new JLabel("Country");
- GridBagConstraints gbc_lblCountry = new GridBagConstraints();
- gbc_lblCountry.anchor = GridBagConstraints.EAST;
- gbc_lblCountry.insets = new Insets(0, 0, 5, 5);
- gbc_lblCountry.gridx = 0;
- gbc_lblCountry.gridy = 0;
- panel.add(lblCountry, gbc_lblCountry);
- countryComboBox = new JComboBox<String>();
- GridBagConstraints gbc_countryComboBox = new GridBagConstraints();
- gbc_countryComboBox.insets = new Insets(0, 0, 5, 0);
- gbc_countryComboBox.fill = GridBagConstraints.HORIZONTAL;
- gbc_countryComboBox.gridx = 1;
- gbc_countryComboBox.gridy = 0;
- panel.add(countryComboBox, gbc_countryComboBox);
- JLabel lblLeague = new JLabel("League");
- GridBagConstraints gbc_lblLeague = new GridBagConstraints();
- gbc_lblLeague.anchor = GridBagConstraints.EAST;
- gbc_lblLeague.insets = new Insets(0, 0, 5, 5);
- gbc_lblLeague.gridx = 0;
- gbc_lblLeague.gridy = 1;
- panel.add(lblLeague, gbc_lblLeague);
- leagueComboBox = new JComboBox<String>();
- GridBagConstraints gbc_leagueComboBox = new GridBagConstraints();
- gbc_leagueComboBox.insets = new Insets(0, 0, 5, 0);
- gbc_leagueComboBox.fill = GridBagConstraints.HORIZONTAL;
- gbc_leagueComboBox.gridx = 1;
- gbc_leagueComboBox.gridy = 1;
- panel.add(leagueComboBox, gbc_leagueComboBox);
- JLabel jornada = new JLabel("Week");
- GridBagConstraints gbc_jornada = new GridBagConstraints();
- gbc_jornada.anchor = GridBagConstraints.EAST;
- gbc_jornada.insets = new Insets(0, 0, 5, 5);
- gbc_jornada.gridx = 0;
- gbc_jornada.gridy = 2;
- panel.add(jornada, gbc_jornada);
- weekSlider = new JSlider();
- GridBagConstraints gbc_weekSlider = new GridBagConstraints();
- gbc_weekSlider.insets = new Insets(0, 0, 5, 0);
- gbc_weekSlider.gridx = 1;
- gbc_weekSlider.gridy = 2;
- panel.add(weekSlider, gbc_weekSlider);
- JScrollPane scrollPane = new JScrollPane();
- GridBagConstraints gbc_scrollPane = new GridBagConstraints();
- gbc_scrollPane.gridwidth = 2;
- gbc_scrollPane.insets = new Insets(0, 0, 0, 5);
- gbc_scrollPane.fill = GridBagConstraints.BOTH;
- gbc_scrollPane.gridx = 0;
- gbc_scrollPane.gridy = 3;
- panel.add(scrollPane, gbc_scrollPane);
- resultsTable = new JTable();
- scrollPane.setViewportView(resultsTable);
- }
- public JSlider getWeekSlider() {
- return weekSlider;
- }
- public JComboBox<String> getLeagueComboBox() {
- return leagueComboBox;
- }
- public JComboBox<String> getCountryComboBox() {
- return countryComboBox;
- }
- private String readURL(String urlRoute){
- try {
- URL url = new URL(urlRoute);
- } catch (MalformedURLException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
- }
- private ArrayList<League> extractLeagues(String xml){
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement