Questions tagged as 'java'

1
answer

Obtain a random value from a map with reverse weights in Java

I have a map from which I want to get a word for a game of the hangman. In the map I keep with each word the times that have already been chosen. For example, the map may contain: abaleadura 4 abajo 2 abalada 1 abalaustrado 3 The map start...
asked by 23.05.2018 / 18:33
1
answer

How to get the number of elements that a JSON has with GSON in Java?

From the Front-end I send the file JSON , then in the Servlet , through GSON I transform it into an object: PrintWriter out = response.getWriter(); String texto = request.getReader().readLine(); Gson gson...
asked by 23.05.2018 / 18:50
0
answers

fill ListView from another Activity

I have a ListView and I want to fill it with data that comes from another activity I bring the data by the intent but I do not know how to change the position of the new element to enlarge the list. The .java of the first activity: public c...
asked by 29.05.2018 / 19:14
0
answers

java upload files

good afternoon I do a file upload project simultaneously with java jsf web aplication and when choosing the files I get the following error HV000028: Unexpected exception during isValid call. the controller is this / *  * To change this...
asked by 26.05.2018 / 21:42
1
answer

JAVA - ERROR IN THE MESSAGE

I have these two classes. Briefly, to the shelf I have to add a bottle ... weight, quantity are variables that I do not yet define ... for that matter they do not matter. The issue is that I find the shelf but it does not add the bottle. I think...
asked by 27.05.2018 / 01:20
0
answers

Problems with setPaintLabels and jslider

I have a question, I've been having problems with the setPaintLabels method in a jslider, when I use the method it makes the jslider disappear and appears only if I fully expand the window since I use the setResizable (false) if someone knows wh...
asked by 23.05.2018 / 05:13
1
answer

How to create a scroll bar?

Well I have a problem, I have 2 methods, one that counts the lines of a .txt file and another method that creates an array of the file lines so that I can print it in a JOptionpane.messagedialog 1st method //metodo que devuelve el numero de...
asked by 23.05.2018 / 06:30
0
answers

Game of life ERROR

I'm doing a somewhat simple code of Conway's famous "Game of Life", this is the creation of the arrangement public class FunInicio { public int [][] llenado() { int [][] you = new int [10][10]; for (int i=0; i<y...
asked by 23.05.2018 / 08:31
0
answers

Update In Excel

Good guys I need your help I want to edit an excel document but I still can not get it to edit in some of the columns what I do is read the URLs directly and then open them from an excel public void read_excel_update() throws Exception, IOExce...
asked by 23.05.2018 / 06:04
0
answers

how to import excel data into 3 tables?

I happen to have 3 tables which are: person: person_id (int), person (string), document (int). animals: id (int), id_person, id_eps, pet (string), age (int). eps: id_eps (int), name (string), cod_eps (int) The fact is that the...
asked by 23.05.2018 / 22:14