Questions tagged as 'java'

2
answers

Return data from a subobject

Here's what I've implemented so far: public class Interface { private List<Usuario> usuarios = new ArrayList(); private List<Tarefa> tarefas = new ArrayList(); Menu menu = new Menu(); public void program()...
asked by 15.11.2018 / 15:45
1
answer

How to make a method wait for the server response in java using Retrofit2?

Hello friends I have the following method that requests the server: public MetaDataR metodo1(final String m) { Call<MetaDataR> call2 = new RetrofitConfig().getMetasService().getMetas(m); call2.enqueue(new Callback...
asked by 03.11.2018 / 14:56
2
answers

How to capture the action of a click on a title that is inside a container and this container is inside a scrollContainer?

How to capture the action of a click on a title that is inside a container and this container is inside a scrollContainer? public void onEvent(Event e) { if(e.type == ControlEvent.PRESSED && e.target == ???????){...
asked by 01.11.2018 / 18:24
1
answer

Conversion difference from Array to ArrayList with "asList" and with constructor

What's the difference between these two ways of converting an array ? If there is any difference, does it impact performance? List<String> list = Arrays.asList(meuArray); ArrayList<String> arrayList = new ArrayList<String>(...
asked by 05.11.2018 / 13:52
1
answer

Java error 'constructor' X in class 'X' can not be applied to given types; "

When compiling the code below I get the following error: Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type: Connection.ConnectionMySQL.<init> And in line public class...
asked by 12.11.2018 / 02:39
2
answers

How to use onActivityResult when there is more than one startActivityForResult

I need to check the status of user yes or in when requesting bluetooth. But I already use the same method for speech recognition. Here is my code: package com.example.audio_auto; import java.io.IOException; import java.io.InputStream;...
asked by 14.02.2015 / 19:06
1
answer

Return vector of integers in java

I'm trying to read a vector of integers and return the amount of ones and the number of zeros, but it always returns at least a zero, even though I did not enter that value. Debugging the code, even at the time of reading, if I enter 5 times the...
asked by 27.01.2015 / 02:58
1
answer

If string starts with "www" automatically insert "https: //"

I'm trying to do the following For the user do not need to type https:// I'm trying to make, when the text of EditText starts with www. it will automatically insert https:// I've tried: if (!s_url.startsWith(...
asked by 15.02.2015 / 20:08
2
answers

Creating an array of type double (not a multidimensional array)

I need to pass two values of type double to a AsyncTask in my application. I tried to define an array using the following code: double latitude = location.getLatitude(); double longitude = location.getLongitude(); double[] coord...
asked by 23.06.2014 / 21:26
1
answer

Put icon inside jLabel in a jTextField

How do I change the way the date is inserted into my jTextField ? What I have is the following: IwanttoinsertthisiconthatisinjLabelwithinmyjTextField.Isthispossible?Update:importjava.awt.*;importjavax.swing.*;classTestingextendsJFram...
asked by 13.11.2014 / 12:25