240 likes | 435 Views
INF120 Basics in JAVA Programming AUBG, COS dept, Fall semester 2013 Reference books: Malik D.S. , Java Programming, From Problem Analysis to Program Design, Cengage Learning, 4e 2010 Farrell J. Java Programming, Cengage Learning, 5e 2010
E N D
INF120Basics in JAVA ProgrammingAUBG, COS dept, Fall semester 2013Reference books:Malik D.S., Java Programming, From Problem Analysis to Program Design, Cengage Learning, 4e 2010 Farrell J. Java Programming, Cengage Learning, 5e 2010 Y.Daniel Liang, Introduction to JAVA Programming, Brief version, Pearson IE, Prentice Hall, 9e 2013Any Java book available in AUBG libraryCourse lecturer: Assoc. Prof. Stoyan Bonev, PhD
INF120 Basics in JAVA Programming AUBG, COS dept, Fall semester 2013 Lecture 30 Title: GUI Advanced Components Presented by students instead make up Reference: MalikFarrell, chap 1, Liang Ch17
Lecture Contents: • Reminder - lecture 24 - GUI Basics • Reminder – lecture 29 – Advanced GUI • Advanced GUI – creating user interfaces • Events for JCheckBox,JRadioButton,JTextField • JTextArea • Components presented by students • JCombobox • JList • JScrollBar, JSlider • Other components …
Reminder – lec24 GUI Basics Topics covered: Frame (class JFrame) as container of controls Layout Managers FlowLayout mgr, GridLayout mgr, BorderLayout mgr Panel (class JPanel) as container of controls Controls Label (JLabel), Text Field (JTextField), Button (JButton), Check box (JCheckBox), Radio button (JRadioButton)
Reminder – JCheckBox To create a check box, use JCheckBox class Check boxes are two-state buttons like a light switch – set/reset, on/off JCheckBox jchk1 = new JCheckBox(“Apple”, true); JCheckBox jchk2 = new JCheckBox(“Orange”, false);
Reminder – JCheckBox JPanel p1 = new JPanel(); … JCheckBox jchk1 = new JCheckBox("Apple", true);JCheckBox jchk2 = new JCheckBox("Orange", false); … p1.add(jchk1); p1.add(jchk2);
Reminder – JRadioButton To create a radiobutton, use JRadioButton class Radio buttons (or option buttons) enable user to choose a single item from a group of choices JRadioButton jrb1 = new JRadioButton("Staff", true); JRadioButton jrb2 = new JRadioButton("Prof", false); JRadioButton jrb3 = new JRadioButton("Stud", false);
Reminder – JRadioButton JPanel p1 = new JPanel(); … JRadioButton jrb1 = new JRadioButton("Staff", true);JRadioButton jrb2 = new JRadioButton("Prof", false);JRadioButton jrb3 = new JRadioButton("Stud", false); … p1.add(jrb1); p1.add(jrb2); p1.add(jrb3);
Reminder – JRadioButton JPanel p1 = new JPanel(); … JRadioButton jrb1 = new JRadioButton("Staff", true);JRadioButton jrb2 = new JRadioButton("Prof", false);JRadioButton jrb3 = new JRadioButton("Stud", false); ButtonGroup group = new ButtonGroup(); group.add(jrb1); group.add(jrb2); group.add(jrb3);
Reminder – lec29 Adv. GUI Topics covered: Events and EvH for JCheckBox, JRadioButton, and JTextField To create listeners for JCheckBox, JRadioButton, and JTextField multiple-line texts using JTextArea Multiple windows applications Controls just mentioned: JComboBox, JList, JScrollBar, JSlider
Lecture 30 Student presentations Format, style and contents List of Components to be presented JComboBox, JList, JScrollBar, JSlider JMenu, JToolBar, JTabbedPane, JSplitPane JSpinner, JTree, JTable
Student presentationsFormat, style and contents Every student should have 7-8 min for presentation to all the class Contents: 1. Component name 2. Purpose. What about component may be used 3. Structure and functionality: 3a Data fields 3b Methods 4. Example(s). To demonstrate running programs
More GUI Components • Student: Diana Manolova • Component: JComboBox • Also known as • choice list, drop-down list • List of items from which the user can choose
More GUI Components Student: Ekaterina Marinova Component: JList Same as combobox, but enables the user to choose a single value or multiple values
More GUI Components Student: Dovran Balyshov Component: JScrollBar Enables the user to select from range of values
More GUI Components Student: Aida Kentassova Component: JSlider Component like scroll bar, but has more properties and can appear in many forms
More GUI Components Student: Gligor Tasev Component: JMenu
More GUI Components Student: Kaloyan Dimov Component: JToolBar
More GUI Components Student: Anna Yakovleva Component: JTabbedPane
More GUI Components Student: Emilia Ersov Component: JSplitPane
More GUI Components Student: Edona Ramadani Component: JSpinner
More GUI Components Student: Mariana Manova Component: JTree
More GUI Components Student: Petar Agov Component: JTable
Thank You For Your Attention! Any Questions?