Questions tagged as 'java'

2
answers

Keep focus of item BottomNavigationView clicked after rotating screen

I have a problem when I rotate the screen. I have the following structure: A HomeActivity that handles the clicks in the BottomNavigationView (there are 4 items) Each BottomNavigationView item loads a Fragment with different data How...
asked by 23.08.2017 / 14:13
2
answers

JavaFX how to close an internal AnchorPane

Hello everyone, my question is I have an AnchorPane child that is added inside the AnchorPane parent in my AnchorPane child. I have a button called CloseAnchorPane my problem. How do I close the AnchorPane child without closing the parent Anch...
asked by 22.08.2017 / 17:46
1
answer

Convert a JSON String to an Array of the JAVA Object

Hello, I can not do the conversion, my string is coming like this. { "empresa1": { "category_id" : "Item 1", "id" : 1, "imagePath" : "imagem", "name" : "empresa 1", "short_desc" : "desc da empresa 1" }, "empresa2":...
asked by 22.08.2017 / 21:22
2
answers

Transform a for in lambda with variable interaction

How do I transform the following into a Lambda code? The idea is to multiply maxScore by i so that with each interaction it raises the number, only for the first 5 results. for(int i=0;i<5;i++){ list.get(i).se...
asked by 04.08.2017 / 15:17
1
answer

Inserting float value into a JSONObject

I have the following situation, I have an object called Item , with a value variable in it. When I enter the value in the json object it changes from 1 or 2 houses after the comma to 15 houses after the comma. Ex: value is 8.9 and chang...
asked by 30.08.2017 / 20:18
1
answer

Javax, @DefaultValues, @PrePersistent, @PreUpdate

I'm learning to tinker with Javax, and Java persistence and want to know if there's any way to leave a default value for the database. Example in SQL: variacao TIMESTAMP DEFAULT CURRENT_TIMESTAMP How would I do this in my Model code? @...
asked by 01.09.2017 / 22:16
1
answer

Error in Spring when starting the server

Imported a Maven project that worked perfectly before, but now I'm giving it error. Every time I try to fix this error, I change the Java versions, deleting and importing them again and so on. Dependencies: </parent> <grou...
asked by 02.07.2017 / 03:21
2
answers

How to save a file in JavaFX or Java?

Code I tried to do but it does not work: JavaFX FXML Application: salvar.setOnAction((ActionEvent e) -> { Stage window = (Stage) cont.getScene().getWindow(); try { String corpo = cont.getText(); FileWriter gravarF...
asked by 30.06.2017 / 22:10
1
answer

how to tell if a class is immutable by JavaDOC?

I wonder if, how, by JavaDOC know whether a class is immutable or not. Is there any field in JavDOC for quick reference since I am using several classes and I do not have much contact with the language. I would like the answer and, if possible,...
asked by 30.06.2017 / 16:12
1
answer

How to get value returned from Get using Volley on android

In the case I want to know how to get only the value of the GET of the link "... / possess_cadastro" to enter the If or Else. public class LoginRequest extends StringRequest { private static final String REGISTER_REQUEST_URL = "http://192.168....
asked by 21.09.2017 / 20:16