Questions tagged as 'java'

1
answer

How to update JTextArea automatically

I created a program that has a for, this generates different values, what I need is to print the values in a JTextArea as 8 values are generated. I've done the following: int tp=2; int pop[][] = new int[tp][8]; Random ran = new Random(...
asked by 15.11.2017 / 20:39
1
answer

Error: java.lang.NullPointerException in project using JDBC

Could help me with the error below, this is one, I'm having error in lines 14 of class TestaLista and error in line 32 of class ContatoDao . Exception in thread "main" java.lang.NullPointerException at br.com.caelum.jdbc.dao.Conta...
asked by 15.11.2017 / 19:37
1
answer

How do I add a pane inside another pane through code like javafx?

I already know how to do this when it comes to AnchorPane , it's something like this: AnchorPane ap = new AnchoPane(); Label lbl = new Label("Qualquer"); ap.getChildren().add(lbl); But when it comes to a Pane normal, I can only...
asked by 15.11.2017 / 19:11
1
answer

If the user accesses the home before logging in, it should be redirected to the index using jsp

What check should I make if the user directly accesses the home.jsp page without logging in?
asked by 15.11.2017 / 04:59
0
answers

Works on NetBeans but not on Android Studio

The following code works for when the user leaves an editText of the form blank. The code worked in NetBeans but in AndroidStudio when you run the APK with a blank field it appears the message that the APP stopped working. Here is the code: /...
asked by 30.10.2017 / 22:21
1
answer

Capturing field of a complex JSON

I'm using the Java language, with the org.json version 2017101 library to capture data from a JSON. Follow JSON below: {query: {"UF":"SP", "results": {"cidades":[ {"cidade":"sao paulo", "contagem":564561}, {"cidade":"rebeirao","contagem":52...
asked by 30.10.2017 / 14:37
0
answers

Smile detection using opencv on android

Hello, I'm having a hard time doing smilie detection using opencv on android. I can do the detection of faces and eyes very well using haar cascade but only the detection of smiles is not working using this method. private Mat image, originalI...
asked by 31.10.2017 / 19:47
0
answers

How to send data from an Activity to a Fragment

I'm trying to send my data from Activity CorridaEsteiraActivity to Fragment FragmentCorrida and save them to listview , but I did not succeed in my attempts, below follow the two classes: public class CorridaEsteiraActivity...
asked by 01.11.2017 / 12:24
0
answers

Fibonacci in Java with recursion [duplicate]

Do I need to create a class or not? import java.util.Scanner; public class Fibonacci { public static int main (String[] args) { //inicio do codigo int fib = 0, count=0, soma=0; Scanner entrada = new Scanner (...
asked by 27.10.2017 / 18:55
1
answer

Call JButon from one JFrame to another

I'm a beginner in this area, and I have a little problem, if you can help me, thank you. I have two Frames one is main (P) and the other (B) I call through a button. In the main screen I have two buttons register and access, when I run the ma...
asked by 27.10.2017 / 21:43