Questions tagged as 'java'

1
answer

Change TextView Text in an Android Fragment

I have TextView within a Fragment (a flip). How do I change the text of this TextView ? Here you are giving NullPointer qtAllImagensLabel = (TextView)findViewById(R.id.qtAllImagensLabel); qtAllImagensLabel.setText("...
asked by 15.07.2014 / 18:17
3
answers

Multithread in web application

I have an application that does some processing on the server and then delivers it to the client. Something like: http://aplicacao:8080/app/videos/extrair/{id}. Where "id" is the item reference for processing. If user retry request 1...
asked by 13.07.2014 / 11:03
1
answer

Comparable and Arrays.Sort

I'm having difficulty using the comparable interface, I should do the increasing comparison of pilots according to their score (class PilotoEquipe ), and then in class CorridaX1 , I need to use Arrays.sort to organize the arra...
asked by 10.09.2014 / 01:49
1
answer

avoid stackoverflow while reading and popular relations

I'm doing a library that populates a random model with random values, to be used in tests, but it happens that when I have a relation like below, I get a StackOverflowException Author @Entity public class Author implements Serializ...
asked by 29.07.2015 / 00:15
1
answer

How to arrange random integer value in descending order in an array in Java?

I need to organize the values that the array randomly receives and leaves them in descending order, but I honestly do not know how to do that, here is my code, I could not organize. package gerarOrganizar; import java.util.Random; public class...
asked by 08.10.2014 / 21:46
2
answers

Detele () - Play Framework - Compilation error

Introduction I am doing a CRUD in my application, everything is perfect however my delete is giving error when compiling Error Task.java package models; import java.util.*; import java.util.*; import play.db.ebean.*; import play....
asked by 08.10.2014 / 16:43
1
answer

How to measure temporal complexity of sorting algorithms?

Given a sort algorithm, eg burble sort, how to measure its runtime? For example, let's say that the input of the array or list has a length of 1000 elements, what is the time measured in "ms" that I should "wait", given that the average time...
asked by 30.09.2014 / 04:57
3
answers

Save same object multiple times

Solution: setar id = null The code saves 10 times if it runs on the Tomcat server, but if it runs on Glassfish it only adds one time. <?xml version="1.0" encoding="UTF-8"?> <persistence version="2.0" xmlns="http://java.sun.com/xm...
asked by 29.01.2014 / 14:09
3
answers

Toggle Jpanels within a single JFrame

In a Java code, I have a Jframe and inside this JFrame I have a contentPane (Jpanel). I have several screens in JPanel format, I want to swap those JPanels by clicking on a button that is docked inside each Jpanel. By clicking this button, the c...
asked by 04.02.2014 / 15:28
3
answers

Fork in Join in Java

During a project I was suggested to use Fork in Join of the Java API instead of threads , I found nothing easy to understand by the examples found on Google. I understand that it is possible to pass a list of tasks and it subdivides a...
asked by 06.02.2014 / 12:33