Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package is3;
- import java.awt.EventQueue;
- import java.util.*;
- import javax.swing.JFrame;
- import java.awt.List;
- import javax.swing.JButton;
- import java.awt.Font;
- import javax.swing.JCheckBoxMenuItem;
- import javax.swing.JRadioButtonMenuItem;
- import javax.swing.JList;
- import javax.swing.JScrollBar;
- import javax.swing.JLabel;
- import javax.swing.*;
- import java.awt.event.MouseAdapter;
- import java.awt.event.MouseEvent;
- public class project {
- private JFrame frame;
- /**
- * Launch the application.
- */
- public static void main(String[] args) {
- EventQueue.invokeLater(new Runnable() {
- public void run() {
- try {
- project window = new project();
- window.frame.setVisible(true);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- });
- }
- /**
- * Create the application.
- */
- public project() {
- initialize();
- }
- /**
- * Initialize the contents of the frame.
- */
- private void initialize() {
- frame = new JFrame();
- frame.setBounds(100, 100, 450, 376);
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.getContentPane().setLayout(null);
- JButton btnAllLocations = new JButton("Select All");
- btnAllLocations.setBounds(54, 295, 70, 29);
- btnAllLocations.setFont(new Font("Lucida Grande", Font.PLAIN, 9));
- frame.getContentPane().add(btnAllLocations);
- JButton btnClearLocations = new JButton("Clear All");
- btnClearLocations.setBounds(118, 295, 70, 29);
- btnClearLocations.setFont(new Font("Lucida Grande", Font.PLAIN, 9));
- frame.getContentPane().add(btnClearLocations);
- JButton btnClearCollumns = new JButton("Clear All");
- btnClearCollumns.setBounds(312, 295, 70, 29);
- btnClearCollumns.setFont(new Font("Lucida Grande", Font.PLAIN, 9));
- frame.getContentPane().add(btnClearCollumns);
- JButton btnAllCollumns = new JButton("Select All");
- btnAllCollumns.setBounds(245, 295, 70, 29);
- btnAllCollumns.setFont(new Font("Lucida Grande", Font.PLAIN, 9));
- frame.getContentPane().add(btnAllCollumns);
- String[] locationList = {"Aberdeenshire","Aberdeenshire", "Angus", "Carslisle", "Angus", "Carslisle","Aberdeenshire", "Angus", "Carslisle","Aberdeenshire", "Angus", "Carslisle","Aberdeenshire", "Angus", "Carslisle"};
- String[] collumnsList = {"Voters", "Income", "Population"};
- JLabel lblLocations = new JLabel("Locations");
- lblLocations.setBounds(86, 43, 61, 16);
- frame.getContentPane().add(lblLocations);
- JLabel lblMeasures = new JLabel("Measures");
- lblMeasures.setBounds(284, 43, 61, 16);
- frame.getContentPane().add(lblMeasures);
- JButton btnNewButton = new JButton("<-");
- btnNewButton.setBounds(0, 0, 55, 29);
- frame.getContentPane().add(btnNewButton);
- JButton btnHome = new JButton("Home");
- btnHome.setBounds(54, 0, 70, 29);
- frame.getContentPane().add(btnHome);
- JScrollPane scrollPane = new JScrollPane();
- scrollPane.setBounds(51, 62, 137, 232);
- frame.getContentPane().add(scrollPane);
- JList Locations = new JList(locationList);
- scrollPane.setViewportView(Locations);
- JScrollPane scrollPane_1 = new JScrollPane();
- scrollPane_1.setBounds(245, 62, 137, 232);
- frame.getContentPane().add(scrollPane_1);
- JButton btnContinue = new JButton("Continue");
- btnContinue.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseClicked(MouseEvent e) {
- frame.setVisible(false);
- }
- });
- btnContinue.setBounds(163, 325, 117, 29);
- frame.getContentPane().add(btnContinue);
- JList Collumns = new JList(collumnsList);
- scrollPane_1.setViewportView(Collumns);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement