how to call a java event for kotlin


how to call the savebutton event from java to kotlin ? I’m using intellij, remembering that I do not want to create this function directly in kotlin I just want to call this function from java to kotlin

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class FormCad {
    public JPanel panel1;
    private JButton button1;
    private JTextField textField1;
    private JButton button2;
    private JTextField textField2;
    public JButton saveButton;

    public FormCad() {
        saveButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent actionEvent) {


    public static void main(String[] args){



instead of new ActionListener() { ... } you can use object : ActionListener() { ... }