Skip to content

a Frame application called Test in which we test various ways to program JLabel, JTextfield, JPasswordField and JButton objects.

Notifications You must be signed in to change notification settings

MSH-trojan/Java_21_JFrame_Test_1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Notes to be aware of:

The action in the textfields is based on the private class TextFieldHandler

The action of the button is using a no-name event listener.

In this Test the method actionPerformed() is using the class JOptionPane for display.

On the use of No-name Class

In the previous example the action of the textfields was processed by the object handler of the private (or inner) class TextFieldHandler,

while the button action was processed by a no-name object of the no-name private class.

The method addActionListener() used in the button case should have in the brackets the processor object.

As the no-name object is of a no-name class which implements the interface ActionListener, Java allows for the identification of that object with new ActionListener().

This shortcut is confusing and you can avoid it if you want.

You can put the button processing inside the actionPerformed() of the textfields.

About

a Frame application called Test in which we test various ways to program JLabel, JTextfield, JPasswordField and JButton objects.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages