Questions tagged as 'java'

6
answers

Problem Scanner class in Java when entering multiple Strings as variables [duplicate]

I'm doing a little program for something more complex than this one, but the main problem I have is that I need to add at least two names but when I run it skips entering the first name. Better explain me in code, this is a small example of wh...
asked by 30.11.2017 / 23:49
1
answer

reorder array java

Good morning, I have two classes in java called Kart and another CarreraKart where I simulate a race. I would like to show in the array that I display the sorting already ordered when they move forward. The method has to be like that is the one...
asked by 29.12.2017 / 10:09
1
answer

TABLE LAYOUT ANDROID

I have the following table with images <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"...
asked by 28.12.2017 / 20:56
1
answer

Android Multi-thread Attempt in TextWatcher

I have an editText in my application which has a TextWatcher implemented in the creation of the class    txtBeneficiary = (EditText) findViewById (R.id.txtBeneficiary)   txtBeneficiary.addTextChangedListener (filterTextWatcher); private Te...
asked by 31.10.2017 / 14:37
1
answer

How to make different actions when pressing a button?

I have found myself in a problem when doing a Java program, and that is that as I have the code it does not matter what button I press that is always going to execute the command of button 1 I think it is because I am wrongly selecting what what...
asked by 09.01.2018 / 14:18
1
answer

Perform random on a jList

I am doing a program that performs a raffle among all the participants, they go from a JTextArea to a JList. When I click on the 'Confirm' button, I pass the text of the JTextArea to the Jlist, deleting the text that is not a name, but when I cl...
asked by 09.01.2018 / 17:56
1
answer

Error initializing a String Array

I am creating a program that lists the contents of a file, the problem that when I initialize my String array I have an error that is not recognized. This is the code: File origen = new File("TEXTO.TXT"); InputStream in = new Fil...
asked by 11.01.2018 / 18:51
1
answer

Infinite Loop addTextChangedListener Android

In the Create of my Activity, I have the following entidadFinanciera.addTextChangedListener(filterTextWatcher); which does private TextWatcher filterTextWatcher = new TextWatcher() { @Override public void beforeTextChanged(CharSe...
asked by 09.01.2018 / 23:44
2
answers

HashMap in java, error counting elements

I have this method that should return the name of the dish of a restaurant with the number of times it is in total of all restaurants. If the dish is returned 1, if it is more than once must count and return those times. but he's only giving me...
asked by 20.11.2017 / 23:20
2
answers

Error trying to use Collections.sort on an ArrayList

Cuenta cuentaUno = new Cuenta(100,30,uno); Cuenta cuentaDos = new Cuenta(80,30,dos); Cuenta cuentaTres = new Cuenta(20,35,tres); Cuenta cuentaCuatro = new Cuenta(120,150,cuatro); Cuenta cuentaCinco = new Cuenta(0,200,cinco); ArrayList<Cuenta&...
asked by 19.11.2017 / 18:23