Questions tagged as 'java'

1
answer

How to show zeros to the left of a binary number in java?

I am trying to convert a hexadecimal number into binary and count the positions where the 1 are, but at the time of doing so, it does not show the 0 on the left side, so the position is affected. For example, I have the hexadecimal number 28...
asked by 26.07.2017 / 05:39
1
answer

How to get the output code that throws an exe executed from java with runtime?

I run a file .exe (for sending images) from java which can pull different output codes depending on the error, this is my class: public static int SendImg(String ip, int puerto, String rutaIMG, String tipo) { Process p =...
asked by 16.08.2017 / 00:19
1
answer

Get the name of a generic class in a java interface

I have the following case: public interface CustomRepository<T> { ... } public class CustomRepositoryImpl<T> implements CustomRepository<T>{ //Como puedo obtener el nombre de la Clase T } //Por ejemplo si uso la clase Usuar...
asked by 29.03.2018 / 23:21
2
answers

How to allow the user to resize a label after creating it in Java?

I am creating a tag editor, which consists of a panel that is where the label is loaded, these can contain text or images, once created I would like the user to be able to resize them. I already have the other functions (move it...
asked by 01.07.2017 / 01:52
2
answers

problem when executing event with a certain number of characters

I need to execute an event in a textfield called "txtcodigo" when it reaches a length of 8 characters, I did it in such a way that when the length is greater than 7 then it calls the "ticket" function, however it is doing when writing 9 characte...
asked by 12.06.2017 / 22:08
1
answer

I can not remove the object from my list DataTable

I am inside my service and here is where I put the parameter so that I receive the id of the row I want to delete. @Transactional public void eliminaHerramienta(Integer idherramienta) { try { Herramienta p = manager.find(Herramient...
asked by 27.06.2018 / 23:15
1
answer

Problem with ExecutorService

I'm doing a project in which I'm going to do a large number of operations that can be done simultaneously, so I thought about creating threads. These operations will give a result that I want to store in a list so that when they finish execut...
asked by 26.05.2017 / 13:22
1
answer

Load different texts in the same TextView (SharedPreferences)

I have two EditText and what I write I keep it in SharedPreferences and I charge it in TextView but I can only load the text of a EditText and not both texts. What I want is to load the two texts in the same TextVi...
asked by 19.05.2017 / 22:58
2
answers

How can I verify if a certain MySQL database exists from Java?

I want to verify if my database exists before continuing with the execution of my program, but I do not know where to start, because I have looked at some examples and nothing has worked for me. This is the query that you want to throw: "SE...
asked by 16.10.2017 / 20:43
1
answer

Is it a waste of resources with a single element?

I have a map with another map in it like the following: Map<Integer, Map<String, Double>> However the second map will always have only one element, so I think I'm wasting memory because at the end of the account a map is a list...
asked by 14.03.2017 / 16:56