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

Classes

class  ColorListener
 
class  LabelListener
 

Public Member Functions

void go ()
 

Static Public Member Functions

static void main (String[] args)
 

Detailed Description

Definition at line 5 of file TwoButtons.java.

Member Function Documentation

◆ go()

void TwoButtons.go ( )
inline

Definition at line 14 of file TwoButtons.java.

14 {
15 frame = new JFrame();
16 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
17 JButton labelButton = new JButton("Change Label");
18 labelButton.addActionListener(new LabelListener());
19 JButton colorButton = new JButton("Change Circle");
20 colorButton.addActionListener(new ColorListener());
21 label = new JLabel("I'm a label");
22 MyDrawPanel2 drawPanel = new MyDrawPanel2();
23 frame.add(colorButton, BorderLayout.SOUTH);
24 frame.add(drawPanel, BorderLayout.CENTER);
25 frame.add(labelButton, BorderLayout.WEST);
26 frame.add(label, BorderLayout.EAST);
27 frame.setSize(500, 300);
28 frame.setVisible(true);
29 }

Referenced by main().

Here is the caller graph for this function:

◆ main()

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

Definition at line 9 of file TwoButtons.java.

9 {
10 TwoButtons gui = new TwoButtons();
11 gui.go();
12 }

References go().

Here is the call graph for this function:

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