Questions tagged as 'java'

1
answer

How do I know if a JDialog window is open or closed?

I wanted to know, how can I tell if a screen, in my case a JDialog is open. Is there any event or way to know this? I'm going to use this "information" as a parameter in a condition, for example, if closed screen does such thing. im...
asked by 16.09.2017 / 22:55
1
answer

How to concatenate variable names in Java

I have a question. I want to generate a total of variables, from a for , so I do not have to write all of them, but I can not concatenate the variable names. I'm trying this way: for(int i = 0; i < 4; i++){ String nome + i = n...
asked by 15.10.2018 / 16:51
1
answer

Problem with "Exception in thread" main "java.lang.NullPointerException" in recursion

I'm trying to implement a genealogical tree in Java but I came across this problem that I can not solve: Exception in thread "main" java.lang.NullPointerException at Arvore.antecessores(Arvore.java:11) at Arvore.antecessores(Arvore.java...
asked by 29.09.2018 / 05:49
1
answer

Code before or after super

When we override a method, it always comes with super of the parent class, but at the time of encoding the right thing to do would be before or after it? In the example below the right would be this: @Override public void onStart...
asked by 29.08.2018 / 06:24
1
answer

How do I access a protected attribute of a package in another package?

I have the animal package with two attributes: name and classification. package heranca; public class Animal{ protected String nome = "Leão"; protected String tipo= "Mamífero"; } ... And I hav...
asked by 02.09.2018 / 19:18
2
answers

Question using while

I'm new to java and would like some help from you, my code is correct following the exercise I'm doing, but I want to increment it using while to ask the user if he wants to repeat the process of the questions ... but my code is not working ......
asked by 11.09.2017 / 23:15
2
answers

Date Mask in EditText

How do I put date masks on EditText of Android, so I get dd/mm/aaaa ?     
asked by 25.05.2017 / 02:25
1
answer

Return array of integers except 0. How do I?

The method receives two numbers per parameter, and returns an array with the odd numbers between these two numbers. public static int[] oddNumbers(int l, int r) { int odd[] = new int[r]; for(int i=0; i<odd.length;i++){ if(...
asked by 30.07.2017 / 19:23
1
answer

Relationship between HotSpot and JVM, JDK / OpenJDK?

What is Java HotSpot and what is its relationship to JVM and JDK / OpenJDK?     
asked by 07.08.2017 / 15:56
2
answers

Format JLabel text with different colors

How can I format a JLabel and its contents with different "properties"? For example, I'd like to be able to set a color for the text of my JLabel , and another for string that is concatenated with it. It's possible? In...
asked by 06.08.2017 / 04:42