Can't figure out a proper way to do a loop that loops until input is valid

Advertisements I’m still learning java programming so forgive my lack of knowledge. It probably is the most simplest thing ever, but I just can’t for the life of me figure out a better way to have the checkTaskDescription method loop until the user input description is below the character limit. So far this is the… Read More Can't figure out a proper way to do a loop that loops until input is valid

else if statement java gui wont execute

Advertisements 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;… Read More else if statement java gui wont execute

Trying to display JOptionPane on button click

Advertisements I am trying to make a JOptionPane display on button click but I keep getting an error saying I’m missing a return statement in my constructor. Any help would be really appreciated. Thanks This is my code so far. import javax.swing.*; import java.awt.*; import java.awt.event.*; import javax.swing.event.*; public class lab9Part1 extends JFrame implements ActionListener… Read More Trying to display JOptionPane on button click