Questions tagged as 'java'

1
answer

How to auto detect the current system language?

package linguagem; import java.util.*; public class Linguagem { public static void main(String[] args) { Locale locale = new Locale("PORTUGUESE", "PT"); System.out.println("Linguagem: " + locale.getDisplayLanguage()); } }...
asked by 13.06.2018 / 11:00
2
answers

Business days and API Java 8, how to check?

How to check if a day is useful using the Java 8 API? It is possible to check if it is Saturday or Sunday, but how to check for example holiday like September 7 (Independence of Brazil) or Good Friday? int ano = 2014; int mes = 5; YearMonth an...
asked by 30.07.2018 / 20:25
1
answer

What does the "|=" operator mean? (with pipeline and no exclamation)

I was doing some research and came across the operator in |= sequence. See: mBuilder.getNotification().flags |= Notification.FLAG_AUTO_CANCEL; There is this operator in JAVA, but I do not know exactly if it follows the same syntax in...
asked by 11.03.2017 / 17:17
2
answers

Removing specific markers from a googlemap

So this app works like this: the user enters a journey from point C (collection) to point E (delivery). These points are shown on the map, in the form of markers, as in the figure below. Now I need to remove markers by clicking on X....
asked by 12.01.2017 / 16:52
1
answer

One touch for more than one event

I'm building a music keyboard, and I'm having trouble playing the next key sound if the user does not take my finger off the screen. Can anyone help me with this? botao1.setOnTouchListener(new View.OnTouchListener() { @Override...
asked by 29.09.2016 / 08:28
1
answer

How to write this java program using javascript and node? [closed]

public class Principal { private static int x = 0; private static int y = 0; public static void sum() { x = y + 1; y = x + 1; } public static void main(String[] args) { for (int i = 1; i <= 10; i++) { Thread a = new Th...
asked by 06.10.2016 / 20:04
1
answer

Ignore attribute in POST using Retrofit

I would like to know how to ignore an attribute of a model in a POST request with Retrofit. In GET requests I want to bring all attributes, but in requests POST I need to send the object without id for example. Sam...
asked by 01.08.2017 / 22:11
1
answer

I get different results when I convert from Character to Decimal in PHP and Java

When I convert á to decimal I get the result 225 with this code in Java: public static int charToDec(String text){return (int) text.charAt(0);} When I convert á to decimal I get the result 195 with this code in P...
asked by 29.07.2017 / 23:16
1
answer

Execute Java class passing parameters to the Scanner

We are creating a Java programming championship and would like students to make an algorithm that reads from a scanner and computes a particular mathematical logic and returns it to the system output. Until this point OK. The problem is that...
asked by 04.05.2016 / 05:16
1
answer

I can not leave JButton on top of JLabel

I have JPanel , and inside it a JLabel of same size. JLabel has an icon associated with it, working as a wallpaper. When I try to put a JButton on top of the JLabel, NetBeans repositions the 2. Would anyone know to answer me...
asked by 22.05.2016 / 05:53