Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CSE205 Lecture 12

CSE205 Lecture 12

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

Javier Gonzalez-Sanchez

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 [email protected] javiergs.engineering.asu.edu | javiergs.com PERALTA 230U Office Hours: By appointment
  2. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 18 jgs

    § JSlider s = new JSlider(0,10); add(s);
  3. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 20 jgs

    JCheckBox c1 = new JCheckBox("checkbox 1"); JCheckBox c2 = new JCheckBox("checkbox 2"); add(c1);add(c2);
  4. 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);
  5. 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);
  6. Javier Gonzalez-Sanchez | CSE205 | Fall 2021 | 26 jgs

    § Object data[] = {"one", "two", "three", "four", "five"}; JComboBox list = new JComboBox(data); add(list);
  7. jgs CSE 205 Object-Oriented Programming and Data Structures Javier Gonzalez-Sanchez,

    Ph.D. [email protected] 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.