Questions tagged as 'java'

1
answer

Store input values in Java

I need to store values with more than one entry. If a program requests 10 entries, should I store in 10 variables? In case the entries are of type Int .     
asked by 30.03.2018 / 02:16
3
answers

Why this piece of code is looping infinite?

All variables are declared and Eclipse is not pointing any errors in the whole code. What I need to do: The user can only choose between 1, 2 and 3. Any other input, including texts (example: test ) and other numbers example: 4 ) should a...
asked by 19.05.2017 / 04:13
1
answer

Separate strings by semicolons but also save semicolons

I'm using split to separate strings by space, enter, and semicolon, but when it's a semicolon I need to store it in a position in the array as well. How to do this? Current Code: String[] textoSeparado = texto.split(" |\n|;");     
asked by 14.10.2017 / 22:35
2
answers

What is wrong with my thread using synchronized - Java

I started to study tread I saw some examples of java7 and java8 using lambda, I came in a part to use the synchronized which is to type a waiting list of threads where the next one and executed after a finish, I am testing but not I'm getting mu...
asked by 15.10.2017 / 00:15
2
answers

How to add text + icon in the label?

I'm having problems, so I can add a JLabel with a word before an icon. I put the image in my package, and I passed the path, the problem is that the label is concatenating with String (the word I put before), and instead of leaving...
asked by 11.05.2017 / 07:06
2
answers

Convert array json into retrofit

I have the following return in json { "cardapio": [ { "tipoprato": "SALADAS", "pratos": [ { "prato": "ALFACE + REPOLHO ROXO" } ] },...
asked by 31.07.2017 / 21:08
1
answer

Creating field with weight format with two decimal places and 3 houses before the comma

I'm trying to create a "weight" field, but I'm having some problems. Weight can range from 2 to 3 decimal places before the point. For example, it could be 80.00 kg or 100.00 kg. However, in the way I'm doing, it forces me to put the 3 houses...
asked by 31.07.2017 / 01:19
1
answer

Why this error

Can anyone please explain this error to me? <% String[][] mesa = new String[30][30]; out.println(""); for(int i=30; i>=0; i--) { for(int n=0; n<((302)+1); n++) { out.print("-"); }...
asked by 21.06.2017 / 05:23
1
answer

How to hide keyboard when exiting EditText? [closed]

I have three edittext, I want it when I click out of them or finish filling my keyboard sum. Being that they are a fragment. How to do this? My XML with the editText. <RelativeLayout android:layout_width="wrap_content" an...
asked by 09.06.2017 / 19:22
2
answers

Problem with special characters

I have an application that downloads a csv file from an ftp server and within that file it contains product information and the app should insert them into a database, however the special characters are coming "zuados", as in the image below:...
asked by 30.03.2017 / 20:22