$30 off During Our Annual Pro Sale. View Details »

CSE205 Lecture 12

CSE205 Lecture 12

Object-Oriented Programming and Data Structures
Java Swing III
(202203)

Javier Gonzalez-Sanchez
PRO

September 22, 2021
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. jgs CSE 205 Object-Oriented Programming and Data Structures Lecture 12:

    Java Swing III Dr. Javier Gonzalez-Sanchez javiergs@asu.edu javiergs.engineering.asu.edu | javiergs.com PERALTA 230U Office Hours: By appointment
  2. jgs Previously … JPanel

  3. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 3 jgs

    JPanel
  4. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 4 jgs

    Pseudo Calculator
  5. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 5 jgs

    Extending JPanel
  6. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 6 jgs

    Extending JPanel
  7. jgs Tabs The class JTabbedPane

  8. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 8 jgs

    Tabs
  9. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 9 jgs

    Tabs
  10. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 10 jgs

    Tabs
  11. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 11 jgs

    Tabs
  12. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 12 jgs

    Tabs
  13. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 13 jgs

    Tabs
  14. jgs JMenu

  15. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 15 jgs

    JMenuBar Jmenu JMenuItem
  16. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 16 jgs

    JMenuBar, Jmenu, JMenuItem
  17. jgs Slider

  18. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 18 jgs

    § JSlider s = new JSlider(0,10); add(s);
  19. jgs CheckBox

  20. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 20 jgs

    JCheckBox c1 = new JCheckBox("checkbox 1"); JCheckBox c2 = new JCheckBox("checkbox 2"); add(c1);add(c2);
  21. jgs RadioButton

  22. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 22 jgs

    JRadioButton b1 = new JRadioButton("one"); JRadioButton b2 = new JRadioButton("two"); JRadioButton b3 = new JRadioButton("three"); JRadioButton b4 = new JRadioButton("four"); b1.setSelected(true); b4.setEnabled(false); ButtonGroup group = new ButtonGroup(); group.add(b1); group.add(b2); group.add(b3); group.add(b4); add(b1); add(b2); add(b3); add(b4);
  23. jgs JList and JComboBox

  24. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 24 jgs

    JList Object data[] = {"one", "two", "three", "four", "five"}; JList list = new JList(data); list.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION); list.setLayoutOrientation(JList.VERTICAL); JScrollPane listScroller = new JScrollPane(list); add(listScroller);
  25. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 25 jgs

    Orientation and Selection
  26. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 26 jgs

    § Object data[] = {"one", "two", "three", "four", "five"}; JComboBox list = new JComboBox(data); add(list);
  27. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 27 jgs

    Questions
  28. jgs CSE 205 Object-Oriented Programming and Data Structures Javier Gonzalez-Sanchez,

    Ph.D. javiergs@asu.edu Fall 2021 Copyright. These slides can only be used as study material for the class CSE205 at Arizona State University. They cannot be distributed or used for another purpose.