Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.58 KB | None | 0 0
  1. package is3;
  2.  
  3. import java.awt.EventQueue;
  4. import java.util.*;
  5. import javax.swing.JFrame;
  6. import java.awt.List;
  7. import javax.swing.JButton;
  8. import java.awt.Font;
  9. import javax.swing.JCheckBoxMenuItem;
  10. import javax.swing.JRadioButtonMenuItem;
  11. import javax.swing.JList;
  12. import javax.swing.JScrollBar;
  13. import javax.swing.JLabel;
  14. import javax.swing.*;
  15. import java.awt.event.MouseAdapter;
  16. import java.awt.event.MouseEvent;
  17.  
  18. public class project {
  19.  
  20. private JFrame frame;
  21.  
  22. /**
  23. * Launch the application.
  24. */
  25. public static void main(String[] args) {
  26. EventQueue.invokeLater(new Runnable() {
  27. public void run() {
  28. try {
  29. project window = new project();
  30. window.frame.setVisible(true);
  31. } catch (Exception e) {
  32. e.printStackTrace();
  33. }
  34. }
  35. });
  36. }
  37.  
  38. /**
  39. * Create the application.
  40. */
  41. public project() {
  42. initialize();
  43. }
  44.  
  45. /**
  46. * Initialize the contents of the frame.
  47. */
  48. private void initialize() {
  49. frame = new JFrame();
  50. frame.setBounds(100, 100, 450, 376);
  51. frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  52. frame.getContentPane().setLayout(null);
  53.  
  54. JButton btnAllLocations = new JButton("Select All");
  55. btnAllLocations.setBounds(54, 295, 70, 29);
  56. btnAllLocations.setFont(new Font("Lucida Grande", Font.PLAIN, 9));
  57. frame.getContentPane().add(btnAllLocations);
  58.  
  59. JButton btnClearLocations = new JButton("Clear All");
  60. btnClearLocations.setBounds(118, 295, 70, 29);
  61. btnClearLocations.setFont(new Font("Lucida Grande", Font.PLAIN, 9));
  62. frame.getContentPane().add(btnClearLocations);
  63.  
  64. JButton btnClearCollumns = new JButton("Clear All");
  65. btnClearCollumns.setBounds(312, 295, 70, 29);
  66. btnClearCollumns.setFont(new Font("Lucida Grande", Font.PLAIN, 9));
  67. frame.getContentPane().add(btnClearCollumns);
  68.  
  69. JButton btnAllCollumns = new JButton("Select All");
  70. btnAllCollumns.setBounds(245, 295, 70, 29);
  71. btnAllCollumns.setFont(new Font("Lucida Grande", Font.PLAIN, 9));
  72. frame.getContentPane().add(btnAllCollumns);
  73.  
  74. String[] locationList = {"Aberdeenshire","Aberdeenshire", "Angus", "Carslisle", "Angus", "Carslisle","Aberdeenshire", "Angus", "Carslisle","Aberdeenshire", "Angus", "Carslisle","Aberdeenshire", "Angus", "Carslisle"};
  75. String[] collumnsList = {"Voters", "Income", "Population"};
  76.  
  77. JLabel lblLocations = new JLabel("Locations");
  78. lblLocations.setBounds(86, 43, 61, 16);
  79. frame.getContentPane().add(lblLocations);
  80.  
  81. JLabel lblMeasures = new JLabel("Measures");
  82. lblMeasures.setBounds(284, 43, 61, 16);
  83. frame.getContentPane().add(lblMeasures);
  84.  
  85. JButton btnNewButton = new JButton("<-");
  86. btnNewButton.setBounds(0, 0, 55, 29);
  87. frame.getContentPane().add(btnNewButton);
  88.  
  89. JButton btnHome = new JButton("Home");
  90. btnHome.setBounds(54, 0, 70, 29);
  91. frame.getContentPane().add(btnHome);
  92.  
  93.  
  94.  
  95. JScrollPane scrollPane = new JScrollPane();
  96. scrollPane.setBounds(51, 62, 137, 232);
  97. frame.getContentPane().add(scrollPane);
  98.  
  99. JList Locations = new JList(locationList);
  100. scrollPane.setViewportView(Locations);
  101.  
  102. JScrollPane scrollPane_1 = new JScrollPane();
  103. scrollPane_1.setBounds(245, 62, 137, 232);
  104. frame.getContentPane().add(scrollPane_1);
  105.  
  106. JButton btnContinue = new JButton("Continue");
  107. btnContinue.addMouseListener(new MouseAdapter() {
  108. @Override
  109. public void mouseClicked(MouseEvent e) {
  110. frame.setVisible(false);
  111.  
  112.  
  113. }
  114. });
  115. btnContinue.setBounds(163, 325, 117, 29);
  116. frame.getContentPane().add(btnContinue);
  117.  
  118.  
  119. JList Collumns = new JList(collumnsList);
  120. scrollPane_1.setViewportView(Collumns);
  121.  
  122. }
  123. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement