java.sql.SQLException: No value specified for parameter 2 error

Advertisements When I run my project then I type the password and username in my project then I encounter the error code: no value specified for parameter 2, even though all parameters should be filled in. String user = username.getText(); String pass = password.getText(); String option = options.getSelectedItem().toString(); if( user.equals("awd") || pass.equals("awd") ) { JOptionPane.showMessageDialog(rootPane,… Read More java.sql.SQLException: No value specified for parameter 2 error

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

JFrame keeps application running even after closing

Advertisements I have a class with only static methods and one of them opens a JOptionPane error message dialogue using a JFrame object as component. This is the class + method: public class miscMethods { static JFrame errorWindow = null; public static void ErrorPopup(String message) { errorWindow = new JFrame(); errorWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); errorWindow.setAlwaysOnTop(true); JOptionPane.showMessageDialog(errorWindow, message, "Error",… Read More JFrame keeps application running even after closing