Questions tagged as 'java'

1
answer

What formula is used to calculate FPS in a game?

I'm creating a game in java using lwjgl3, I've seen many algorithms but they're all different from each other. So simplifying my code would be like this: start(); while(running){ update(); render(); } exit(); What formula could...
asked by 02.01.2017 / 20:14
1
answer

How to get a JSON, from a URL?

I'm still studying AndroidStudio and it's time to get data by URL, in json format,    To do this I created an example page:   ( link ),       with the following content:   {"content": "hello world"} THEN I took the example here...
asked by 27.01.2017 / 02:02
1
answer

How to change a menu item after it has already been created? [closed]

This is what I create a menu through the onCreateOptionsMenu method, and then I want to leave an item invisible but I can not. @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.filter_menu,...
asked by 29.12.2016 / 22:14
2
answers

cURL - Consuming webservice with PHP

I have the following code: $url_data = "http://localhost:8080/sistema/webservice/agenda/consultarHorariosDisponiveis"; $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded')); curl_seto...
asked by 19.07.2016 / 14:37
1
answer

Detached exception in associative table

I'm finding the following problem when making a certain registration: Exception in thread "main" javax.persistence.PersistenceException: org.hibernate.PersistentObjectException: detached entity passed to persist: br.com.arena.model.Pessoa...
asked by 15.07.2016 / 17:55
1
answer

How to change the name in the android application package?

The current name of my package is com.newapp.nomedopacote . Well, in case I want to change it to com.newapp.novopacote , without any damage to the application. I tried to simply do a refactor and it lost the R file. How can I do t...
asked by 21.02.2015 / 03:41
2
answers

JAVA - Draw Polygons (triangles, pentagons)

Well, I wanted to know if anyone could help me, I'm doing a project in which I have to draw several figures, including triangles and pentagons, I've already managed to get the rectangles to work, rectangles: import java.awt.Color; import ja...
asked by 18.12.2015 / 20:31
1
answer

ExpandableList Custom

I'm new to Android, but with an ambitious project. I'm trying to make a% custom% with two ExpandableList on items and the one on the left needs to have the background changed as per customer satisfaction. ItturnsoutthatIjustcannotseem...
asked by 29.12.2015 / 16:23
1
answer

How to use JProgressBar while method (return value) performs reading of XML files?

I have a little knowledge in Java and I have already researched the internet on how to use a JProgressBar while I run a method, but I have not got any examples that work according to my needs since my method returns a value. Logica = I have a Cl...
asked by 24.12.2015 / 12:44
1
answer

How to make a Carousel

I'm trying to create a Carousel on Android like this from this video , but it's not working too well.     
asked by 22.08.2016 / 20:20