Presentation is loading. Please wait.

Presentation is loading. Please wait.

Java GUI. Overview The ”idea” The ”idea” The Components The Components Listeners Listeners The Program The Program Interface Eventlistener Interface Eventlistener.

Similar presentations


Presentation on theme: "Java GUI. Overview The ”idea” The ”idea” The Components The Components Listeners Listeners The Program The Program Interface Eventlistener Interface Eventlistener."— Presentation transcript:

1 Java GUI

2 Overview The ”idea” The ”idea” The Components The Components Listeners Listeners The Program The Program Interface Eventlistener Interface Eventlistener My Experiences My Experiences

3 The ”idea” Log which shows events Log which shows events The events are to influence a ball The events are to influence a ball The ball itself is also to make changes to the gui The ball itself is also to make changes to the gui

4 The Components JTextArea JTextArea JScrollPane JScrollPane JTextField JTextField JLabel JLabel JButton JButton JSlider JSlider JCheckBox JCheckBox

5 Interface EventListener

6 Listeners ActionListener ActionListener Buttons and CheckBox Buttons and CheckBox ChangeListener ChangeListener Slider Slider ItemListener ItemListener CheckBox CheckBox ActionListener (with timer) ActionListener (with timer)

7 ActionListener closeButton.addActionListener(new Event()); closeButton.addActionListener(new Event()); private class Event implements ActionListener { private class Event implements ActionListener { public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) { Object source = e.getSource(); Object source = e.getSource(); if(source == closeButton) { if(source == closeButton) { System.exit(0); System.exit(0); } … } … }

8 The Program You will now be shown the program in action You will now be shown the program in action

9 My Experiences Not hard to work with Not hard to work with Quite straight forward Quite straight forward If you can’t find the method you are looking for you are using the wrong component. If you can’t find the method you are looking for you are using the wrong component.

10 Thanks for ”listening”


Download ppt "Java GUI. Overview The ”idea” The ”idea” The Components The Components Listeners Listeners The Program The Program Interface Eventlistener Interface Eventlistener."

Similar presentations


Ads by Google