Questions tagged as 'java'

1
answer

How to align JButton text to the left of the icon?

I need to align the text of JButton to the left of the icon as I do? I tried using the button.setHorizontalAlignment(SwingConstants.LEFT); But this method does not align the text the way I want it. It's getting the same as the...
asked by 21.02.2018 / 19:33
1
answer

Timeout on task execution Asynctask

How do I limit the execution time of a Asynctask and return a warning when the limit is reached? The method looks for a json from a webservice, but it may be off the air, and when that happens the app will try for a long time until it...
asked by 15.02.2018 / 11:06
1
answer

Error with query in Hibernate

I'm trying to accomplish the following Query in hibernate: return this.entityManager .createQuery("SELECT u FROM UploadArquivoCondominio u WHERE " + " u.condominio = :ucondominio ) "...
asked by 15.02.2018 / 20:49
1
answer

PSQLException: No result returned by query

I can not identify the error that is returning when trying to insert data into the DB. I believe the error is in the insert function. The error returned is:    Exception in thread "main" org.postgresql.util.PSQLException: No result retu...
asked by 15.02.2018 / 14:20
2
answers

String Format CPF on Android

I have a CPF variable that is populated with a value that comes from the database (% w / w). Before giving 11122233344 , I need to be formatted as setText() . How could I do this?     
asked by 21.02.2018 / 14:11
1
answer

Search for strings in string

In a java-filtered search using .startWith (query) for example: I want to search for "Military Police" in the search I type "Police" and police appears, okay. If I type "military", it does not appear in my search. How do I search th...
asked by 12.05.2018 / 13:43
1
answer

Recycleview item returning the same data for all items when clicked

I have a list of addresses in Recycleview and each address has its latitude and longitude coordinates retrieved from the database. But when I click on the list item to start a route from the coordinates always brings the same in all items. What...
asked by 06.05.2018 / 10:30
1
answer

RecyclerView Android

I wanted to make the imageButton appear in case item.getPrint () == true. It seems to work okay but if scrolling the RecyclerView down starts appearing problems, it starts appearing even where item.getPrint () == false. I know that recycleview w...
asked by 07.02.2018 / 18:53
1
answer

Print all 0

I declare the following variable: int sequencia = 000000000; At the time of printing, you are only printing a 0. Does anyone know how I can print all 0 (zeros)? How do I auto-increment to the point that every time I change the value t...
asked by 01.02.2018 / 15:19
1
answer

Compare Android Studio Strings

I started a few days to learn android development, I am trying to create a simple login system for testing only. But when I create an event for the login button, the EditText string comparison does not work. When I click the button it goes to th...
asked by 08.07.2018 / 20:43