else if statement java gui wont execute

I have been trying to make a java GUI distance converter. My else if statement won’t execute, only the first if statement execute. Does anyone know why i wont executed? Below is my coding and the output. import javax.swing.*; import java.awt.BorderLayout; import java.awt.FlowLayout; import java.awt.event.*; public class DistanceCalculator implements ActionListener { private JFrame frame; private… Read More else if statement java gui wont execute

Swing JButton not working on actionPerformed method

I have this beginner’s project. This time I started from the basics. Source code: https://github.com/kontext66/GuwiPos/blob/main/GuwiPos The button is working fine with the lambda approach: buttonBasket.addActionListener(e -> System.out.println("Item Added to Basket!: "); But when I try to use actionPerformed here to print out the content of the txtGroup, it does not show anything. This is the… Read More Swing JButton not working on actionPerformed method