Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.io.IOException;
- import javax.swing.KeyStroke;
- public class KWBAController {
- private KWBAModel model;
- private KWBAGUI gui;
- public KWBAController(KWBAModel m1, KWBAGUI g1) throws IOException{
- this.model = m1;
- m1.getPicture();
- this.gui = g1;
- g1.getMntmRefresh().setAccelerator(
- KeyStroke.getKeyStroke("F5")
- );
- g1.getMntmRefresh().addActionListener(
- new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- try {
- model.getPicture();
- gui.refreshPicture();
- } catch (IOException e1) {
- e1.printStackTrace();
- }
- }
- }
- );
- g1.getMntmAbout().setAccelerator(
- KeyStroke.getKeyStroke("F1")
- );
- g1.getMntmAbout().addActionListener(
- new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent arg0) {
- gui.showHelp();
- }
- }
- );
- g1.getMntmExit().addActionListener(
- new ActionListener(){
- @Override
- public void actionPerformed(ActionEvent e) {
- System.exit(0);
- }
- }
- );
- }
- @SuppressWarnings("unused")
- public static void main(String args[]){
- try {
- KWBAController c = new KWBAController(new KWBAModel(), new KWBAGUI());
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement