Questions tagged as 'java'

2
answers

Select a row of a JTable and pass data to jTextFields - JAVA

I have a class called " Compra.java " ( JFrame ) where there is a JTable with NO purchased vehicles available for sale, if I select a row (a vehicle) from that table and pulse the JButton " button_buy "you should send m...
asked by 13.01.2017 / 08:38
2
answers

Save an instance with different data in ArrayList

I'm trying to save different objects of the same class in an ArrayList, from an instance that is changing the value of the properties, I do not know if I explain. Here is a code that illustrates what I want to do. Player Class: package juga...
asked by 16.01.2017 / 00:39
1
answer

What happens with the reference to the object?

My intention was to create a JForm in which to play the cat, every time you save that JForm in a list, at the end of a certain number of games won (4 in this code) show the windows that you save in the list where you can see how th...
asked by 17.01.2017 / 00:13
2
answers

use method post to add a record

According to what each method has its objective:    post to insert records,       get to get / show records,       put to modify records,       delete to delete records I made the following code, which adds a new book to the bd then I...
asked by 30.04.2017 / 22:23
1
answer

Error retrieving a String after storing it as Object

I have this part of code: System.out.print("nombre: "); String nombre = leer.nextLine(); while(!nombre.equals("fin")){ mc.insertar(mc, 0); System.out.print("nombre: "); nombre = leer.nextLine(); } for (int i = 0; i < mc.cantida...
asked by 29.04.2017 / 20:32
1
answer

how does maping work in spring?

I have the following code: import java.util.List; import org.springframework.data.repository.Repository; import net.javabeat.spring.data.domain.Book; public interface BookNamedQueryRepositoryExample extends Repository<Book, Long> {...
asked by 01.05.2017 / 04:52
1
answer

Validate field number / number maximum characters JAVA

I have the following validation: -consumo: número decimal o entero (por ej: 10.5, 8, 16, 9.5, etc.) Why do you fail me? I put the code: public class Validaciones { public static boolean validarFecha(String fecha){ SimpleDa...
asked by 02.01.2017 / 18:10
1
answer

modify a file that is inside a jar [closed]

Could someone tell me how I can modify text files that are found in a jar, everything from java code. I've tried everything but nothing works.     
asked by 09.01.2017 / 01:37
1
answer

Hide keyboard when clicking anywhere in the Activity

First of all, I have seen the questions on this topic but no answer has helped me, so I decided to open a new one. I want the keyboard to close whenever I click outside of it, it does not matter if I do it in a TextView , ImageView...
asked by 11.03.2017 / 22:46
2
answers

Class DATE show in main

I have created a program that saves a date by default and I have added a method to increase the day (+1) to the current date and another to increase the month. I do not know how to show the method IncreaseMes and increaseDia in the main p...
asked by 23.01.2017 / 18:51