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
votes3
answers1061
viewsWhile Resultset.next() returning only one result
I have a problem when I put the ResultSet.next() in the while and get the information from the column of the Database returns me only one result. Table 'People': Pessoas: Idade: Marcos 22 Marcos 24…
-
0
votes0
answers65
viewsInstantiating a Webview
I have a simple application that with a given link returns an html page. I’m doing this with a Webview, it’s working normally, but I don’t want the user to see the Webview on the mobile screen.…
-
0
votes0
answers77
viewsJAVA-Correct way not to read enter key
I am making the problem 1168 - LED and would like to know if there is a way to make my in.nextLine() do not read the enter key,I managed creating a variable to read this enter,but I’m sure it is not…
-
0
votes1
answer179
viewsAutocomplete with New Registration option - JAVA
I have a autoComplete on the sales screen, when the user enters the customer’s name I want that if it has no record it displays something like "ADD NEW CUSTOMER", I’m wearing primefaces:…
-
0
votes3
answers101
viewsMysql printing multiple times
I’m having a problem printing Mysql data in Eclipse. When I put to print the list of registered data it is printing 3 times each information. I know where the problem is, but I can’t see the…
-
0
votes0
answers1197
viewsSpringframewok Httpmediatypenotsupportedexception: Content type 'text/Plain;charset=UTF-8' not supported
I’ve been trying to find solutions to this mistake and I can’t find. Error: 2018-07-24 16:44:50.541 WARN 25695 --- [nio-8080-exec-2] .w.s.Defaulthandlerexceptionresolver : Resolved Exception caused…
-
0
votes1
answer39
viewsHow to use different fonts in the same Text field
I ask for help, I am trying to build a simple program that contains a text field (Edittext) and two buttons. The idea is to write some text in my text field and then if I click the first button I…
-
0
votes1
answer38
viewsRelate disciplines and students of a pre-registration system
I’m doing a pre-registration system, and I came across a problem that bothers me a little bit: As you can see in the picture, Curso has Disciplinas and Estudantes, only that each student needs to…
-
0
votes1
answer136
viewsInfinite loop while recovering and recording data in Firebase
I’m a beginner on Android and had a problem recovering data from Firebase and record again, I know the reason for the infinite loop but I don’t know how to fix. public static void setVoto (String…
-
0
votes1
answer621
viewsHow to Load an Activity using Progressbar
Progressibar Code in XML <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="match_parent"…
-
0
votes1
answer67
viewsHow to stop a for via external loop interference?
I have a for running and clicking on the button I want this for stop. for (int i = 0; i < codigo.size(); i++) { if (codigo.get(i).contains("Para") || Stop == true){ sendCommand("parou"); break; }…
-
0
votes2
answers54
viewsProblem in the JSP Controller class
Hello, I need help, I have the problem in my system when I send an edit command. When I click on the edit button of the table row that I want, the screen turns white and does not show the options to…
-
0
votes0
answers59
viewsAndroidstudio problem does not work on AVD
Good evening I have a problem, I have no idea how much help I may need from you! I am developing an Android application in Android studio in the code is all correct compiles legal has no syntax…
-
0
votes1
answer126
viewsShuffle List
I would like to shuffle an Arraylist, and I’m trying to do this with Collections.Sort(), but I don’t think it’s happening The code I’m using is this: Thread t = new Thread(new Runnable() { @Override…
-
0
votes1
answer122
viewsWEB Service SOAP instantiating class
Good afternoon guys, I’m trying to instantiate a class of WS SOAP but this is giving the following error. follows below the code of my method : public void consultaOperadoresSafra(){…
-
0
votes2
answers381
viewsAverage input data algorithm
package ifal2; import java.util.Scanner; public class Lista3Questao4 { public static void main(String[] args) { Scanner entrada = new Scanner(System.in); int idade=0, contM=0, contF=0; double…
-
0
votes1
answer99
viewsSave data to more than one node in Firebase
Well I have the following code: private void abrirCadastroContato() { String emailContato; emailContato = "email"; int contador = 1; while (contador <=3) { if (contador == 1) { emailContato =…
-
0
votes0
answers101
viewsCompiling and running the java and Maven application with the same encoding
I have an application I am compiling using Maven from the command line. In my pom.xml I specified the encoding using: <properties>…
-
0
votes2
answers45
viewsArraylist statico returns size 0 when I try to recover it in an Activity
I have This class: abstract public class ListaEstaticaDeErros { private static ArrayList<DescritorDeErro> listErros = new ArrayList<DescritorDeErro>(); private static boolean fimSinc =…
-
0
votes1
answer522
viewsProblem using parameter in Preparedstatement
I wonder if there is any problem in using the variable "parameter" after "AND", because when I tested putting the column name directly in SQL it worked and when I try to pass the column name with…
-
0
votes0
answers21
viewsAbout: Vertx Errors
I was testing my application, and when I ran, I got the following error: =============================================================================== BloodStrike Lobby Server Créditos: ExtremsX…
javaasked 6 years, 9 months ago Júlio Sousa 11 -
0
votes1
answer479
viewsHow to save file from one folder to another?
I have a listview which displays the files from an external folder (usb). I want to select one of these files and save in an internal folder (Basket). Here it is when I select an item of this mine…
-
0
votes2
answers852
viewsError running mobile app
When executing react-native run-android gives the following error: FAILURE: Build failed with an Exception. What Went Wrong: Execution failed for task ':app:mergeDebugResources'. Error:…
-
0
votes1
answer1050
viewsJava, write to a specific line of a file . txt
I’ve been testing several ways to write the data of a variable in a text file (.txt), but I need to know if you can write this variable in a given line, so I could organize multiple data in the same…
-
0
votes0
answers185
viewsError in Datatable - JSF 2.2 "rowkey" attribute with Primefaces 6.2
I’m a beginner in JSF and I’m having problem with the attribute rowkey datatable. He just can’t find the reference I put to my attribute var. It’s like the name I put on var only fit the components…
-
0
votes0
answers28
viewsHow to implement a Gameview code within a class?(in java code for android)
I am new in java and I am developing a project, I have the following code below: Paint.setColor(Color.rgb(250, 0, 255)); canvas.drawCircle(Xa, ya, 10, Paint); Which I use in the Gameview draw method…
-
0
votes1
answer940
viewsStore values in vector
I have an exercise on vetores/arraywith simple value, where I must correct a test, comparing it with the feedback and also calculate the percentage of students who reached the average. 6) Make a…
-
0
votes1
answer39
viewsHow to initiate page in case of error in web.xml JAVA
I need to trigger an error page in case of exceptions. I put that code on web.xml: <error-page> <exception-type>java.sql.SQLException</exception-type> <location>/Casa da…
javaasked 6 years, 9 months ago Leandro Santos 453 -
0
votes1
answer748
viewsSpring Authenticationmanager that could not be found
I’m trying to set up the Oauth2 in my study application only it is returning me an error that I am not able to solve required a bean of type…
-
0
votes1
answer69
viewsRemove word accentuation in searchView
I’m trying to remove the accent from the researcher’s words, but my code isn’t working. I’d like you to look at an example word Você all variations ofVoce, Você, você, você, VOCE, VOCÊ. Thank you…
-
0
votes0
answers110
viewsPerform a Job with Quartz and Spring
I need to run a job, I am using Quartz, but when the job is executed I need to go to the database to make a query but it does not work, returns the following error, I am using Spring and Hibernate:…
-
0
votes1
answer89
viewsJava error when creating private class
Every time I try to create a private class in java I’m not getting it. Follow the full code below. package execucaodeprogramas; import java.awt.event.ItemListener; import javax.swing.JCheckBox;…
javaasked 6 years, 9 months ago Lucian Rodrigues 99 -
0
votes0
answers118
viewsPass parameters from one Adapter class to another Activity
I need the help of Voce, create a class called Itensadapter that creates a listview with the database data, until ai blz, now I need to capture this data in another Activity to enter the quantities…
java android android-studio android-activity android-adapterasked 6 years, 9 months ago Lioni Beats 1 -
0
votes1
answer542
viewsI’m doing an integration with Cielo’s api but I get an error message:
I’m doing an integration with api-Cielo 3.0 but I’m getting an error message: application code package cieloecommerce.sdk.ecommerce; import java.io.IOException; import cieloecommerce.sdk.Merchant;…
-
0
votes1
answer105
viewsImage in the Primefaces menubar
Hello, I have a problem that is not able to put an icon to the left of the menubar and the menu items to the right, someone can help me? <h:body> <h:form> <p:menubar> <f:facet…
-
0
votes2
answers124
viewsValueeventlistener coming back null?
I’m messing with the API of a website and from there I get information from a certain item in a list of items that came from the API and saved in the Firebase database, now I’m wanting to take this…
-
0
votes2
answers260
viewsSpringmvc controller does not redirect to another controller
No Controller Logincontroller.java @Controller @RequestMapping("/login") public class LoginController { @Autowired private UsuarioRepositorio usuarioRepositorio; @RequestMapping(method =…
-
0
votes1
answer118
viewsType Mismatch: cannot Convert from Unmarshaller to Pool.Unmarshaller
I’m getting this eclipse error message in a Rest project java client code. package cliente; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import…
-
0
votes1
answer268
viewsNull return when using Double type variable
I am having difficulties in some methods (when you will have to return or when you are void ,parameters or not etc). Why the last two methods of Employee is returning null? package employee; public…
javaasked 6 years, 8 months ago Fabio Ricardo Ferreira 3 -
0
votes0
answers276
viewsJaspersoft - List consuming space when empty
I have a report that has a group header and within it there are two lists. I made a treatment via expression to print each of the lists only when there is content for each of them, but when one of…
-
0
votes2
answers345
viewsEdittext vehicle mask
I would like to know how to create a mask in an Edittext in ABC-1234 format. I’m trying something as an example below, but still unsuccessful. public abstract class PlacaVeiculoMask { public static…
-
0
votes1
answer72
viewsHow to print special characters by CMD when formatting coins?
A few days ago I did an exercise to format coins and used the following code for this: String us, china, france; us = NumberFormat.getCurrencyInstance(Locale.US).format(payment); china =…
javaasked 6 years, 8 months ago Van Ribeiro 1,482 -
0
votes1
answer75
viewsProxy problems with Okhttp
I’m using the library Okhttp to request my application to the facebook api, but I need to work on a proxy network, when instantiating OkHttpClient() and call OkHttpClient.newCall(request).execute()…
-
0
votes1
answer337
viewsHow to submit via java post?
In a system all data is exposed via URL due to the sending method GET. I need to send via POST. Code: <!DOCTYPE html> <html> <head> <meta charset="ISO-8859-1">…
-
0
votes1
answer111
viewsNumber(3.0) field in Oracle database for Java
I have a table in an Oracle 11g database with a field of type NUMBER(3,0) In a Spring project, I own the following: @Repository public interface TipoPropriRepository extends…
-
0
votes0
answers385
viewsChat with multiple customers using Threads and Sockets
The code here posted represents a small chat between client and server. As I said, I’m not familiar with threads. The teacher told us, from this code, to create a multi-client chat, where clients…
-
0
votes0
answers92
viewsChange object in p:dialog taking object from datatable primeFaces
I have a DataTable with a button to add a note to the service. I can pick up the object, step to the Dialog, but my save button does not upadate the object <body> <ui:composition…
-
0
votes0
answers102
viewsHow to insert various user input values into Java dictionary?
I want to allow multiple pairs (key, value) to be inserted into a dictionary, in Java, from user-typed values. I made a loop for to try to insert but could not, because every time a new pair(key,…
-
0
votes2
answers569
viewsReturn False or True
I need to know if the second number is multiple of the first number, if yes return true otherwise false, I’m having trouble declaring the library Boolean. package br.fatec.com; import…
-
0
votes0
answers414
viewsEclipse error using Tomcat 9.0 Tomcat server - Error 404
I’m trying to run a web site using Servlet Tomcat9,where the user will enter his salary, and according to the salary range will be made a readjustment on this old salary! The language used is JAVA I…