Questions tagged as 'java'

1
answer

How can I get data from a table in a database and store it in variables? (Java)

Friends I need to obtain the information of the fields of a database and store them in variables to later manipulate them, I have been searching the internet and I found the following sentence: ResultSet resultado = (ResultSet) sentencia.execu...
asked by 19.10.2018 / 01:38
2
answers

Update Jtable after Inserting a Data into the Database

I have a problem when I want to update a Jtable, when I click on the insert button, the entered data should appear in the table but nothing appears. this what I have in the insert button Detail: insertar ins = new insertar(); ins.insdetfa...
asked by 16.10.2018 / 19:14
1
answer

Problem with java threads

I'm not sure how to get something like this to appear when I run:    Thread1 is running task 1   The main (parent) thread has finished its execution   Hilo1 is running task 2   Hilo1 is executing task 3   Hilo2 is running the task 1   Hi...
asked by 18.10.2018 / 13:20
1
answer

Why does this method return me the wrong amount of matches?

public int obtenerNumOraciones(String texto) { Pattern patron = Pattern.compile("[a-z]*"); Matcher match = patron.matcher(texto); int cant = 0; while(match.find()){ cant++; } return cant; } If I put text = hel...
asked by 07.10.2018 / 07:35
3
answers

Program that convert binary to decimal

I try to make a program that takes a string, evaluates each character and performs the corresponding operation according to its position to reach the result. this is what I have, but I can not find the correct algorithm import java.util.Sca...
asked by 02.11.2018 / 07:37
1
answer

Help with Program in JAVA: ArrayIndexOutOfBoundsException

I have a program that pretends to be a Contacts Diary, the problem is that adding more data to ArrayList the program does not work for me: public ArrayList<modeloPersona> LeerTodoArchivo(String Archivo){ ArrayList<modeloPer...
asked by 18.09.2018 / 16:47
1
answer

I do not run a program with Java fixes correctly

public class AlumnosA { String [] alumnos = new String[2]; int []calificacion = new int[2]; String []letra = new String[2]; String a; int c; String estatus; String cal; public void alumno(){ Scanner tecl...
asked by 19.09.2018 / 05:22
2
answers

The JButtons do not occupy the full width of the JPanel with GridBagLayout, how do I solve it?

I have a problem that when I load the buttons with the SQLite data when adding them to the panel with a While traversing the DB, I do not add them to them in the form of a vertical list, nor does it expand them to the size of the JPanel. contain...
asked by 29.09.2018 / 03:23
1
answer

Open Jframe with click on Jtable (Netbeans)

I am generating a Jtable that has several data, however I need to click on the first cell of each row to open a new Jframe, I have tried with events, but I can not generate it to work specifically there .... So I need to select Registration numb...
asked by 01.10.2018 / 16:21
1
answer

"CompareToIgnoreCase" does not work

I'm doing a program that compares attributes to me and returns the value (-1, 0, 1) when my attributes are the same or not. This is my method code: public int Comparar(CostosImpl CostosRef, CostosImpl CostosHerr, boolean cotizar) { if(...
asked by 20.11.2018 / 18:30