Questions tagged as 'java'

3
answers

Use ArrayList to save data of different value

I'm trying to save different types of data in an arraylist, mainly String and int to have a database of people. After looking for ways to do it, I decided to create a separate class. class Persona { private String nombre; private int...
asked by 04.05.2018 / 15:39
1
answer

Problem with String in Java using Scanner

I'm having a problem with this code. I want to make the user answer "yes", then ask for a number. The problem is that by asking again "More data?" it does not let you enter the string again and does not repeat the while again. My code: im...
asked by 14.04.2018 / 14:11
3
answers

String instead of jlabel

I have an interface with 60 jlabels, named like this: A1 A2 A3 .... A60 The idea is to change the color according to a condition, but I would have to put 60 "if". The idea would be to change the label by means of a string. The line of code...
asked by 31.03.2018 / 16:39
3
answers

Iterate a List in Java

How can I iterate this list to get the names: Class Cards: public class Tarjetas { private List<Tarjeta> tarjetas; public List<Tarjeta> getTarjetas() { return tarjetas; } public void setTarje...
asked by 31.03.2018 / 12:58
2
answers

How to use Timer and TimerTask tool

I want the program to check every second if the if condition is met, but I get some errors, I do not know what I'm doing wrong, this is the code: package alarmexample.example.com.alarmexample; import android.app.Activity; import androi...
asked by 04.04.2018 / 08:47
2
answers

Android: How to do different events by touching a button and keeping it pressed?

I am working on an android project, where I need a button to perform 2 different actions in certain circumstances: When you touch it (do not hold it down), do the event1. When you hold down for 5 seconds, do the event2. In the res / lay...
asked by 05.04.2018 / 15:10
1
answer

Can you recycle an activity to use it in various activities in Android Studio?

I'm doing a project of an app that will have a button to make a new record, the app has as main activity the listing of data in listview by clicking on it the previous activity appears but to update. SqlLite     
asked by 25.03.2018 / 03:15
1
answer

Send image through Http Post

Hello everyone, I'm trying to send a node file (Client) to my Java web service using Jersey the file is received correctly using POSTMAN this is my Java code: @POST @Path("eliminar") @Consumes({ MediaType.MULTIPART_FORM_DATA, ("text/plain"...
asked by 25.04.2018 / 16:40
4
answers

I can not see anything on the design screen. (Android Studio)

I just started with Android Studio and it gives me nothing but problems. In principle when I create a basic activity project, everything seems to be going well. but when I enter the graphic part of the design screen I see this and I do not see a...
asked by 13.06.2018 / 16:30
3
answers

Browse directory recursively

I'm doing a program creating, modifying and scrolling directorios and archivos , I'm stuck in the part of showing on the screen the content of a directorio and in the case of having sub-directorios show what these they...
asked by 14.06.2018 / 00:51