1 / 24

INF120 Basics in JAVA Programming AUBG, COS dept, Fall semester 2013

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

audi
Télécharger la présentation

INF120 Basics in JAVA Programming AUBG, COS dept, Fall semester 2013

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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

  2. 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

  3. 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 …

  4. 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)

  5. 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);

  6. Reminder – JCheckBox JPanel p1 = new JPanel(); … JCheckBox jchk1 = new JCheckBox("Apple", true);JCheckBox jchk2 = new JCheckBox("Orange", false); … p1.add(jchk1); p1.add(jchk2);

  7. 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);

  8. 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);

  9. 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);

  10. 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

  11. 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

  12. 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

  13. 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

  14. More GUI Components Student: Ekaterina Marinova Component: JList Same as combobox, but enables the user to choose a single value or multiple values

  15. More GUI Components Student: Dovran Balyshov Component: JScrollBar Enables the user to select from range of values

  16. More GUI Components Student: Aida Kentassova Component: JSlider Component like scroll bar, but has more properties and can appear in many forms

  17. More GUI Components Student: Gligor Tasev Component: JMenu

  18. More GUI Components Student: Kaloyan Dimov Component: JToolBar

  19. More GUI Components Student: Anna Yakovleva Component: JTabbedPane

  20. More GUI Components Student: Emilia Ersov Component: JSplitPane

  21. More GUI Components Student: Edona Ramadani Component: JSpinner

  22. More GUI Components Student: Mariana Manova Component: JTree

  23. More GUI Components Student: Petar Agov Component: JTable

  24. Thank You For Your Attention! Any Questions?

More Related