Most voted "java" questions
Use this tag when the question refers to some resource, information, or problem relating exclusively to the Java programming language. Java is a class-based, statically typed, reflective, and execution environment (JRE) language. Java programs are compiled to bytecode and run on a virtual machine (JVM), allowing a "write Once, run Anywhere" philosophy (WORA).
Learn more…14,468 questions
Sort by count of
-
0
votes0
answers168
viewsSelect Date AM - PM Timepicker Android
I have a Timepickerdialog configured in my project and is working properly. When choosing the time I have the following option - PM or AM. Code: private void timePicker(){ // Get Current Time final…
-
0
votes1
answer2103
viewsDynamically populate fields according to CEP JSP Javascript
I want that when typing my zip code and clicking on the search button, it returns the data from the street,state,neighborhood and Uf but when clicking on the search button it is not calling the…
-
0
votes0
answers393
viewsAndroid studio ERROR java.lang.Nullpointerexception
I’m developing a code in android studio and using bluetooth communication. I want to make that if a specific data received by bluetooth is greater than such value, automatically generates a…
-
0
votes1
answer318
viewsCalculator Androistudio
Good night I am creating an application using 5 "boxes" (EditText) where he could multiply the boxes he wanted. Example: value1 * value2= resu.... value1*value2*value3=resu.... value1*value2*va…
-
0
votes1
answer141
viewsIncrease/Decrease Seekbar progress with Button action?
Someone can help: How to increase and decrease seekBarHomem progress through Button action? @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);…
-
0
votes1
answer1378
viewsGoogle Sheets - Sending Email
I have the following code that sends emails through a Google spreadsheet. function sendEmails() { var sheet = SpreadsheetApp.getActive(); var startRow = 2; var planMensagens =…
-
0
votes1
answer325
viewsCode with indeterminate entries, showing pairs in ascending and odd order in descending order
I’m doing an exercise where the user places an indeterminate amount of numbers and they have to be presented by dividing the pairs of the odd ones, being the pairs increasingly and the odd…
-
0
votes1
answer135
views -
0
votes1
answer45
viewsProblem with Firebasepp call
I have a fragment that performs user registration and login using Firebase. However, I’m having trouble with the initializeApp(Context) method. Follows the code: @Override public View…
-
0
votes1
answer303
viewsError validating Java user, Spring
I have an error validating the user next to the database. I’ve debugged and the data (which you see from the front end) is being received by the API. The method that makes the search in the database…
-
0
votes1
answer194
viewsHow to implement an arraylist in one condition?
I need this code to have a class Estudante, one Professor and another Disciplina. I’m trying to limit the class students Disciplina in 50 with a ArrayList and a condition, but maybe they’re in the…
-
0
votes1
answer803
viewsCalling Javascript function from Java (Webview android)
I am with a simple doubt to understand but I have not found solution.I have a Webview in my MainActivity where is loaded a responsive Website that I created, in this Website I have a shopping cart…
-
0
votes2
answers51
viewspassing parameters between activitys
could help me with this android studio code ...I do not cosnigo recover the string to run if: public void Green(View view) { String cor3 = "verde"; Bundle parametros = new Bundle();…
-
0
votes1
answer151
viewsChained list sorted with errors in add
I have the following sorted chained list, but am getting errors in my first method (add). The error message appears in all 3 interactions where I compare the values of the nodes with the operator…
javaasked 7 years ago Cléo Sousa 123 -
0
votes2
answers195
viewsHow to list the latest message from all conversations
I’m creating a chat in android studio, so I need to list the last message between the chat user and his contacts, regardless of whether he sent or received the last message. I have selected below on…
-
0
votes1
answer66
viewsHTML Entities in PHP and Java
I’m using htmlentities() in PHP to store data in the database, overwriting c, ã, and other characters by HTML entities: <?PHP htmlentities ("Ampliação"); //Resulta na string…
-
0
votes0
answers64
viewsAndroid notification buttons do not appear on mobile device
I always interacted with my Android application by emulator, but recently I started to test everything I did with my phone. I created some notifications with buttons, and in the emulator they appear…
-
0
votes1
answer101
viewsWebservice delete error
I have a problem in my webservice. It is giving this error: Requestfailed Requestfailed --> Status: (405) The code I’m using: @DELETE @Produces("text/plain") @Path("ExcluirLista/{usuario}")…
-
0
votes1
answer38
viewsProblem with Nullpointerexception
I got a class like this: public class TileRender { private Map mapa; private TileMap tileMap; private Tile[] tiles; private List<ObjectPointMap> objMap; public TileRender(TileMap tileMap, Map…
-
0
votes3
answers814
viewsI cannot display Spring error message
I’m trying to validate some annotated fields, but I can’t bring the messages to the jsp page: Java user. mport java.util.Calendar; import javax.validation.constraints.Email; import…
-
0
votes1
answer668
viewsAn imageview receive image according to the selected option
I wish you could enlighten me on a situation. I want to change the image of an Imageview. I can even do it through the: final ImageView imageView = (ImageView) findViewById(R.id.imageChm);…
-
0
votes0
answers547
viewsError in webservice: javax.servlet.Servletexception: java.lang.Nullpointerexception
I am trying to execute a query in my Webservice, but the function that query is inside of, break from nothing. My code: public boolean excluir(String usuario) { String sql = "DELETE * FROM…
-
0
votes2
answers627
viewsButton in Fragment android
I own a Fragment and this fragment, has a Floatingactionbutton. I invoke the method onClickListener: FloatingActionButton floatingActionButton = (FloatingActionButton)…
-
0
votes1
answer68
viewsHow to clean Asynctasks from memory after run?
I am developing a commercial APP, in this need to load all customers of the establishment, so I make a request requesting each client, because I need to send the Id of this in the URL of the…
-
0
votes2
answers2660
viewsHow to take value from a Radiobuton within a Radiogroup to save in the bank
wanted to know how I took the value of a Radiobutton to save it in the sqlite bank. In the example below the instructor does as follows: public class FormularioHelper { private Aluno aluno; public…
-
0
votes1
answer3056
viewsName [name] is not bound in this Context. Unable to find [jdbc]
In the expectation of improving the performance of BD access I started to implement a pool of connections within my Web Application. But every time I will give a lookup on the application I think…
-
0
votes2
answers231
viewsDifficulty reading XML in Java
I’m trying to learn, and I’m having a hard time reading an XML by taking it via the Web and turning it into an object. There is a ready code in which it connects to the site, and another that a…
-
0
votes1
answer59
viewsDoubt with decision making
My dears, I have the following code: public static void questionTwo(){ String back = ""; Scanner scan = new Scanner(System.in); System.out.println("Questao 02: "); while(!back.equalsIgnoreCase("N")…
-
0
votes1
answer139
viewsConfigure orphanRemoval=true in Generate Entities of Table - JPA Tools - Eclipse
I’m having trouble every time I need to use JPA Tools' Generate Entities of Table (use Eclipse Neon.3). I run entities with the Generate Entities of Table command from JPA Tools. In the code of a…
-
0
votes1
answer33
viewsDoubt about sum of information
I’m doing some exercises on composite variables and I’ve reached an impasse in my code, which at first I can’t solve despite it seems to be something simple. At the time of the display of the…
-
0
votes0
answers330
viewsHow to read a txt file and encrypt its contents
I’m having trouble with the FileReader and buffered. I’ve seen several tutorials plus some are very different from each other and am unable to read my file to encrypt. I have my AES code here:…
javaasked 7 years ago Murilo Neto 1 -
0
votes1
answer422
viewsChanging position of a Marker
I have a Mapsactivity class, where it starts at a fixed point set on the map. I’m calling a Thread, where the Map is only fully loaded, when the return is true. (I will do a search in a comic book…
-
0
votes1
answer27
viewsSummarizing the result of several logical tests in a single result
Good afternoon, I have some strings that come from tests. Example: String teste2 = (nB < 0.0 && m1 <= j ? "OK" : "Não passa!"); String teste3 = (nB < 0.0 && m2 <= j ?…
-
0
votes1
answer35
viewsReturn of incorrect bank values when filling a Jtable
I have a Registration Class, which is responsible for the View. I have this code: public void listarTabela(){ DefaultTableModel val = (DefaultTableModel) jTable3.getModel();…
javaasked 7 years ago Pedro Anselmo 35 -
0
votes2
answers456
viewsHow to set a background color and borders for my button beyond the states pressed and not pressed on the button with?
I would like besides my button to have a lower edge more than had the button states pressed, not pressed would be another color... I am trying to do all this in my drawable xml to set a background…
-
0
votes0
answers150
viewsFirebase authentication check problem (Number phone)
Hello! I am trying to build a firebase record with phone number. I did the procedures I found in:…
-
0
votes1
answer431
viewsCheck if you have reached the last row of the table
I’m using this code to do a approved or flunked, but when he gets to the last line, he’s not checking if he’s on the last line and he doesn’t give me the result. I would like to know how to check if…
-
0
votes1
answer52
viewsAdapt txt file reader
I was using a manual method to grab a txt file, where the user typed the file name and extension and pressed the button, now that replace by a code that opens a search box to choose the file on the…
-
0
votes2
answers514
viewsQuery result null Firebase
Hello folks I’m having a problem to perform query in firebase database. This is the bank: I’m trying to carry out a search of all the restaurants that have the name Iguatemi, until then according to…
-
0
votes1
answer95
viewsNullpointerexception in Java web
I’m having a problem in a JSP that should insert a project to my work returning me as an error, this virtually identical an exercise I did earlier, so I don’t understand the reason for the error.…
-
0
votes0
answers120
viewsHttpurlconnection with Mysql and Webservice
I am trying to create a connection class to feed information into a Mysql database as follows: import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import…
-
0
votes0
answers167
viewsRead Entire with Bufferedreader on Android
In an Android application, I have a java socket client that sends integers (using writeInt) to a socket server on Android that I’m trying to read these integers. I receive correct strings but I…
-
0
votes1
answer333
viewsPopular a spinner with data stored in a node in Firebase for Android
I’m performing a service for a client where I need to popular a Spinner with data stored in a node in Firebase. I’ve tried several tutorials, but no result. I created two entities in my project, an…
-
0
votes1
answer272
viewsincompatible types Boolean cannot be converted to Usuarios
I am creating a function to insert new users in the database, but present this error: "incompatible types: Boolean cannot be converted to Usuarios". Does anyone know a way to solve this case: public…
-
0
votes1
answer1068
viewsHow to return the values of an arraylist in Java
I am unable to return the values of the arraylist. I created a Student class with some methods. In another class I create an arraylist of the type Student and add values. However when I show nothing…
javaasked 7 years ago Diego Soares 403 -
0
votes1
answer295
viewsProblems connecting Postgres with java
Well, I’m having a problem connecting my java application to my database (I’m using pgAdmin4 which is basically postgres). Java code: public class ConnectionFactory { private static final String…
-
0
votes2
answers154
viewsInheritance persistence, one-to-one relationship and manual primary key
I’m developing a heritage web project to finish my degree. I am using Java (IDE: Spring Tool Suite), Spring, Hibernate and Mysql. I’m having a data modeling problem that I’m having trouble solving:…
-
0
votes1
answer142
viewsProblems with <p:ajax> on primefaces
Good morning friends! I am a beginner in Java and am trying to develop a system for church management. After many attempts, I can make ajax work, but I am not able to recover the id of the state…
-
0
votes3
answers3880
viewsHTTP status 500 Internal server error
I have a problem in my web application in spring boot compiles and starts the server, but when it starts localhost:8080/buscar appears the following error: Controller class: package…
-
0
votes1
answer697
viewsImport org.apache.Commons.io.input library from Java to Eclipse
I need to use the class Reversedlinesfilereader, which belongs to the org.apache.Commons.io.input library. @Tommelo told me that I should include a dependency of this library in the archive pom.xml…