Questions tagged as 'java'

1
answer

Play and stop button for .wav file

I have this code: import java.io.File; import javax.swing.JFrame; import javax.swing.JButton; import javax.swing.JPanel; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import java.awt.GridLayout; import java.awt.Flow...
asked by 14.02.2018 / 18:10
1
answer

How can I get the password of a windows user in java?

I have already tried with the class System but with this class I can only get the user in the following way: System.out.println(System.getProperty("user.name")); Now what I need is to get the password , I tried to find a comman...
asked by 12.04.2018 / 18:19
1
answer

java.lang.RuntimeException: Unable to start activity ComponentInfo

I do not understand why these errors came out I saw in google that it was because I had a code above setContentView() but I removed all the code from that java file and I just left the design and still did not close the application. Re...
asked by 09.02.2018 / 19:19
2
answers

Change hexadecimal of colors.xml android studio

I have an activity in which I need to change the color to several elements, so doing it one by one can be a bit tedious. These elements share a common denominator that is the color from the corresponding resource. Is it possible to change the...
asked by 29.01.2018 / 03:13
1
answer

Create a new array based on another array, but without the repeated data

As the title says, I am trying to create a second array based on an original array, but issuing the values that are repeated. My problem is that the code does not work as I would expect, since whatever I do I can not generate the new array wi...
asked by 09.04.2018 / 04:11
1
answer

Avoid leaving the gridview hidden when there are no results in the search

In my app, implement a SearchView. I managed to make it work perfectly but I had several doubts when I saw it work: I need a mechanism for when there are no results I show a textview that there is not ... so I did the following searchView.s...
asked by 25.01.2018 / 06:12
1
answer

I can not solve a problem with an if

I'm doing a game in which you have to calculate the time in seconds that is requested by keyboard, and when that time exceeds the end of the game. But when it goes through that if , it does not calculate time or it's infinite or it just le...
asked by 24.01.2018 / 20:40
2
answers

How to make an ArrayList and as a result of the program I will paint them as a table!

I have a program in java using ArrayList, the detail that I want as a result I would paint them as if it were a table, that is: Nombre|ApellidoMaterno |ApellidoPaterno Juan |Bustamante |Solis And so on This is my code: public...
asked by 25.01.2018 / 23:30
1
answer

Android, Internal Persistence offline

I'm currently using sqlLite for some things, but I was wondering if there is any simple way to save for example a STRING in the internal base of the phone without the need to use external libraries,?     
asked by 25.01.2018 / 14:55
1
answer

Am I configuring something wrong? - Locationlistener generates erroneous locations

Good morning, I am developing an application where I get the user's location through the LocationListener class of Android Java, the problem is that sometimes it locates me correctly, sometimes it locates me to more or less 10 or 20 meters of er...
asked by 24.01.2018 / 20:21