Questions tagged as 'java'

2
answers

How to calculate distance from user's location with another address?

What I need to do is pretty simple, but I do not know how. It works like this: I pass an address to the user and as soon as he is in the place he presses a button, when doing this the application should know if it is in the (or very close) lo...
asked by 27.09.2015 / 18:34
1
answer

Read all the txt files in a folder

I'm trying to list in my project all the files I've saved in the program before in the Query folder, but it does not only show the files, it also shows their respective paths. How do I make this function more organized only with the names of the...
asked by 21.06.2016 / 15:47
3
answers

I have 5 threads running in parallel. How do I know when it's all over?

If I make a join for each of them, they will run in sequence, one at a time. I needed to start the 5 in parallel and know when they were all done to do something. Does anyone know if and how is it possible? Thank you in advance.     
asked by 17.11.2015 / 15:38
2
answers

Check if day x falls on a Saturday or Sunday

I am making a system that will be an Agenda, in this system you have an option to repeat the appointment except fortnightly, that is, I save the appointment and the system will notify me every 15 days. But this commitment can not fall into sá...
asked by 10.07.2015 / 16:36
2
answers

Modify XML features through Java

I have the following RelativeLayout : <RelativeLayout android:id="@+id/layout_avancado" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="#FF00...
asked by 22.12.2014 / 05:24
2
answers

Old Game - Implement logic

Well, my final work of the semester is to put together a game of the old one in java, I made all the look of it, but the problem comes from there: I need to make every click of the mouse change the button icon (first click an X, second click an...
asked by 31.05.2014 / 07:22
2
answers

Doubt - setDefaultCloseOperation

Would it be possible to somehow move to: setDefaultCloseOperation(UM METHODO?); Or using some other option to do the same procedure? What happens is that I created a button and it calls a "method" to hide the program. I need to click on...
asked by 30.03.2015 / 14:12
2
answers

Performance in Java repetition loops

What a difference of performance between the three types of ties highlighted below. List<Foo> list = new ArrayList<Foo>(); for (int i = 0; i < list.size(); i++) { //CODE } for (Foo foo : list) { //CODE } Iterator<F...
asked by 31.03.2014 / 16:28
1
answer

Null Pointer after try catch

Servlet: @WebServlet("/AdicionaContato") public class AdicionaContatoServlet extends HttpServlet { @Override protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {...
asked by 06.03.2018 / 11:58
1
answer

Fibonacci Sequence

I need to exercise on the Fibonacci sequence:    Each new term in the Fibonacci sequence is generated from the sum   of the 2 previous terms. If we start with 1 and 2, the first ten   numbers are: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... Consid...
asked by 06.05.2017 / 21:31