Advertisement
Guest User

Untitled

a guest
May 20th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. import java.awt.*;
  2. import java.awt.event.*;
  3. import javax.swing.*;
  4. import javax.swing.event.*;;
  5.  
  6. class Gui_ListChoice1 {
  7.  
  8. public static class Window extends JFrame
  9. {
  10. Window()
  11. {
  12. addWindowListener(new WindowAdapter()
  13. {
  14. public void windowClosing(WindowEvent e)
  15. {
  16. dispose();
  17. }
  18. });
  19.  
  20. setLayout(null);
  21. setSize(400,300);
  22. setVisible(true);
  23.  
  24.  
  25. List list1 = new List(4,false);
  26. list1.add("1");
  27. list1.add("2");
  28. list1.add("3");
  29. list1.add("4");
  30. add(list1);
  31. list1.setBounds(150,10,80,60);
  32.  
  33. List list2 = new List(3,true);
  34. list2.add("1");
  35. list2.add("2");
  36. list2.add("3");
  37. add(list2);
  38. list2.setBounds(150,150,80,60);
  39.  
  40. }
  41. }
  42.  
  43.  
  44.  
  45.  
  46. public static void main(String[] args)
  47. {
  48. new Window();
  49.  
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement