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

Public Member Functions

void actionPerformed (ActionEvent event)
 
void go ()
 

Static Public Member Functions

static void main (String[] args)
 

Detailed Description

Definition at line 5 of file TextAreaEx.java.

Member Function Documentation

◆ actionPerformed()

void TextAreaEx.actionPerformed ( ActionEvent event)
inline

Definition at line 31 of file TextAreaEx.java.

31 {
32 text.append("button clicked\n");
33 }

◆ go()

void TextAreaEx.go ( )
inline

Definition at line 13 of file TextAreaEx.java.

13 {
14 JFrame frame = new JFrame();
15 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
16 JPanel panel = new JPanel();
17 JButton button = new JButton("Just Click It");
18 button.addActionListener(this);
19 text = new JTextArea(10, 20);
20 text.setLineWrap(true);
21 JScrollPane scroller = new JScrollPane(text);
22 scroller.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
23 scroller.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
24 panel.add(scroller);
25 frame.add(panel, BorderLayout.CENTER);
26 frame.add(button, BorderLayout.SOUTH);
27 frame.setSize(350, 300);
28 frame.setVisible(true);
29 }

Referenced by main().

Here is the caller graph for this function:

◆ main()

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

Definition at line 8 of file TextAreaEx.java.

8 {
9 TextAreaEx gui = new TextAreaEx();
10 gui.go();
11 }

References go().

Here is the call graph for this function:

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