COMP2396
Loading...
Searching...
No Matches
question1 Class Reference
Collaboration diagram for question1:

Classes

class  BiggerListener
 
class  LeftListener
 
class  MyDrawPanel
 
class  RightListener
 
class  SmallerListener
 

Public Member Functions

void go ()
 

Static Public Member Functions

static void main (String[] args)
 

Detailed Description

Definition at line 5 of file question1.java.

Member Function Documentation

◆ go()

void question1.go ( )
inline

Definition at line 21 of file question1.java.

21 {
22 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
23 // putting all buttons together
24 JPanel panel = new JPanel();
25 frame.add(panel, BorderLayout.NORTH);
26 // all buttons
27 JButton left = new JButton("left");
28 JButton right = new JButton("right");
29 JButton smaller = new JButton("smaller");
30 JButton bigger = new JButton("Bigger");
31 panel.add(left);
32 panel.add(right);
33 panel.add(smaller);
34 panel.add(bigger);
35 // adding listeners for buttons
36 left.addActionListener(new LeftListener());
37 right.addActionListener(new RightListener());
38 smaller.addActionListener(new SmallerListener());
39 bigger.addActionListener(new BiggerListener());
40 // drawing panel
41 frame.add(drawPanel);
42 // preparing to launch
43 frame.setSize(300, 300);
44 frame.setVisible(true);
45 }

Referenced by main().

Here is the caller graph for this function:

◆ main()

static void question1.main ( String[] args)
inlinestatic

Definition at line 17 of file question1.java.

17 {
18 question1 gui = new question1();
19 gui.go();
20 }
void go()

References go().

Here is the call graph for this function:

The documentation for this class was generated from the following file: